window.thumbnails = {};
															thumbnails[8773001] = clik.newPhoto({"id":8773001,"src":"20th-july-2010_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[8785621] = clik.newPhoto({"id":8785621,"src":"006_9579E5DE-1E4F-37DC-71CADD0A269930FC_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":128});
															thumbnails[4985870] = clik.newPhoto({"id":4985870,"src":"1_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4985870.html","width":130,"caption":"Head of St. Lobius","height":173});
															thumbnails[4985874] = clik.newPhoto({"id":4985874,"src":"4_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4985874.html","width":130,"caption":"Lonesome Sunnyland ","height":173});
															thumbnails[4985891] = clik.newPhoto({"id":4985891,"src":"3_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4985891.html","width":130,"caption":"Festival of Britain","height":173});
															thumbnails[4985929] = clik.newPhoto({"id":4985929,"src":"5_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4985929.html","width":130,"caption":"Across the bridge","height":178});
															thumbnails[4985935] = clik.newPhoto({"id":4985935,"src":"6_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4985935.html","width":130,"caption":"Down in the Alla","height":178});
															thumbnails[4985945] = clik.newPhoto({"id":4985945,"src":"7_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4985945.html","width":130,"caption":"Cawl","height":170});
															thumbnails[4985950] = clik.newPhoto({"id":4985950,"src":"8_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4985950.html","width":130,"caption":"Pharaoh","height":180});
															thumbnails[4985953] = clik.newPhoto({"id":4985953,"src":"9_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4985953.html","width":130,"caption":"Salt Beef","height":178});
															thumbnails[4985956] = clik.newPhoto({"id":4985956,"src":"10_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4985956.html","width":130,"caption":"Walking Blues","height":177});
															thumbnails[4991568] = clik.newPhoto({"id":4991568,"src":"20_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_4991568.html","width":130,"caption":"New Rose","height":173});
															thumbnails[4991582] = clik.newPhoto({"id":4991582,"src":"211_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_4991582.html","width":130,"caption":"Big Pink","height":173});
															thumbnails[4991583] = clik.newPhoto({"id":4991583,"src":"22_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_4991583.html","width":130,"caption":"Bad Boy","height":173});
															thumbnails[4991588] = clik.newPhoto({"id":4991588,"src":"23_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_4991588.html","width":130,"caption":"Full of ideas","height":192});
															thumbnails[4991594] = clik.newPhoto({"id":4991594,"src":"24_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_4991594.html","width":130,"caption":"Burn out","height":199});
															thumbnails[4991595] = clik.newPhoto({"id":4991595,"src":"25_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_4991595.html","width":130,"caption":"Melt Down","height":173});
															thumbnails[4991598] = clik.newPhoto({"id":4991598,"src":"26_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_4991598.html","width":130,"caption":"Green mollusc","height":98});
															thumbnails[5141126] = clik.newPhoto({"id":5141126,"src":"Bushes_and_Briars_1_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_5141126.html","width":130,"caption":"Bushes and Briars","height":173});
															thumbnails[5141144] = clik.newPhoto({"id":5141144,"src":"Cannonball_Blues_1_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_5141144.html","width":130,"caption":"Cannonball Blues","height":173});
															thumbnails[5141147] = clik.newPhoto({"id":5141147,"src":"I_mailed_it_in_the_air_1_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_5141147.html","width":130,"caption":"I mailed it in the air","height":173});
															thumbnails[5141151] = clik.newPhoto({"id":5141151,"src":"Straight_Life_1_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_5141151.html","width":130,"caption":"Straight Life","height":175});
															thumbnails[5731902] = clik.newPhoto({"id":5731902,"src":"fractured_surface_12_002_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_5731902.html","width":130,"caption":"Ain't Seen No Whiskey","height":98});
															thumbnails[5748976] = clik.newPhoto({"id":5748976,"src":"paintings_for_blog_12_jan_027_CA6D5199-1EC9-D45B-1C9080F7BFD3FAFC_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_5748976.html","width":130,"caption":"Peach Orchard Series: Spike","height":173});
															thumbnails[5749031] = clik.newPhoto({"id":5749031,"src":"peach_orchard_seriesEgg_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_5749031.html","width":130,"caption":"Peach Orchard Series: Egg","height":173});
															thumbnails[5749051] = clik.newPhoto({"id":5749051,"src":"Peach_Orchard_series_stratified_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_5749051.html","width":130,"caption":"Peach Orchard Series: Stratified","height":173});
															thumbnails[5749116] = clik.newPhoto({"id":5749116,"src":"Peach_Orchard_series_Horns_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_5749116.html","width":130,"caption":"Peach Orchard Series: Horns","height":173});
															thumbnails[5808310] = clik.newPhoto({"id":5808310,"src":"new_paintings_for_blog_jan_212010_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_5808310.html","width":130,"caption":"Holes in the fabric","height":98});
															thumbnails[6575256] = clik.newPhoto({"id":6575256,"src":"new_paintings_for_blog_jan_18_2010_002_thumb.jpg","galleries_id":283238,"server_id":18,"link":"photo_6575256.html","width":130,"caption":"Take this Hammer","height":95});
															thumbnails[6575267] = clik.newPhoto({"id":6575267,"src":"abstact_expression_thumb.jpg","galleries_id":283238,"server_id":18,"link":"photo_6575267.html","width":130,"caption":"Three Sisters","height":98});
															thumbnails[6575377] = clik.newPhoto({"id":6575377,"src":"abstact_expression_3_thumb.jpg","galleries_id":283238,"server_id":18,"link":"photo_6575377.html","width":130,"caption":"Fourth Sister","height":99});
															thumbnails[6575387] = clik.newPhoto({"id":6575387,"src":"fractured_surface_4_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6575387.html","width":130,"caption":"Red Desert","height":173});
															thumbnails[6575396] = clik.newPhoto({"id":6575396,"src":"fractured_surface_5_002_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6575396.html","width":130,"caption":"Down on the Turpentine Farm","height":173});
															thumbnails[6575401] = clik.newPhoto({"id":6575401,"src":"Sitting_on_top_of_the_world_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6575401.html","width":130,"caption":"That's alright mama","height":173});
															thumbnails[6575406] = clik.newPhoto({"id":6575406,"src":"9th_May_2010_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6575406.html","width":130,"caption":"Interregnum","height":98});
															thumbnails[6575410] = clik.newPhoto({"id":6575410,"src":"14th_June_2010_004_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6575410.html","width":130,"caption":"Accretion","height":173});
															thumbnails[6603427] = clik.newPhoto({"id":6603427,"src":"oils_24_aug_001_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6603427.html","width":130,"caption":"Dog Star","height":83});
															thumbnails[6603428] = clik.newPhoto({"id":6603428,"src":"oils_22_aug_001_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6603428.html","width":130,"caption":"Rufus","height":177});
															thumbnails[6603433] = clik.newPhoto({"id":6603433,"src":"22_july_2010_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6603433.html","width":130,"caption":"Hereward","height":173});
															thumbnails[6734667] = clik.newPhoto({"id":6734667,"src":"oils_8th_sept_10_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6734667.html","width":130,"caption":"The Black Prints","height":91});
															thumbnails[6744358] = clik.newPhoto({"id":6744358,"src":"oils_15th_sept_10_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6744358.html","width":130,"caption":"Usher's Well","height":173});
															thumbnails[6744360] = clik.newPhoto({"id":6744360,"src":"oils_13th_sept_10_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6744360.html","width":130,"caption":"Skinningrove","height":188});
															thumbnails[6944688] = clik.newPhoto({"id":6944688,"src":"oils_19th_Oct_10_001_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6944688.html","width":130,"caption":"Towton","height":180});
															thumbnails[6944701] = clik.newPhoto({"id":6944701,"src":"oils_15th_Oct_10_001_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_6944701.html","width":130,"caption":"Corryvreckan","height":173});
															thumbnails[8626030] = clik.newPhoto({"id":8626030,"src":"001_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8626030.html","width":130,"caption":"it was there","height":98});
															thumbnails[8635964] = clik.newPhoto({"id":8635964,"src":"005_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8635964.html","width":130,"caption":"on the rocks (submerged)","height":173});
															thumbnails[8760142] = clik.newPhoto({"id":8760142,"src":"0013_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8760142.html","width":130,"caption":"When we met.","height":173});
															thumbnails[8760146] = clik.newPhoto({"id":8760146,"src":"003_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8760146.html","width":130,"caption":"Green heron - Canal Triptych","height":101});
															thumbnails[8760148] = clik.newPhoto({"id":8760148,"src":"010_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8760148.html","width":130,"caption":"","height":181});
															thumbnails[8760150] = clik.newPhoto({"id":8760150,"src":"008_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760150.html","width":130,"caption":"","height":98});
															thumbnails[8760151] = clik.newPhoto({"id":8760151,"src":"007_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760151.html","width":130,"caption":"","height":96});
															thumbnails[8760153] = clik.newPhoto({"id":8760153,"src":"002_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760153.html","width":130,"caption":"","height":178});
															thumbnails[8760154] = clik.newPhoto({"id":8760154,"src":"0031_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760154.html","width":130,"caption":"","height":173});
															thumbnails[8760155] = clik.newPhoto({"id":8760155,"src":"004_56B3E973-24E8-5EC4-4F4A557D3B19963E_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760155.html","width":130,"caption":"","height":92});
															thumbnails[8760156] = clik.newPhoto({"id":8760156,"src":"005_56B8BE72-24E8-5EC4-4FD5FBAC2F3F7544_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760156.html","width":130,"caption":"","height":91});
															thumbnails[8760157] = clik.newPhoto({"id":8760157,"src":"0061_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760157.html","width":130,"caption":"","height":94});
															thumbnails[8760158] = clik.newPhoto({"id":8760158,"src":"0071_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760158.html","width":130,"caption":"","height":97});
															thumbnails[8760159] = clik.newPhoto({"id":8760159,"src":"0081_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760159.html","width":130,"caption":"","height":94});
															thumbnails[8760160] = clik.newPhoto({"id":8760160,"src":"009_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760160.html","width":130,"caption":"","height":88});
															thumbnails[8760161] = clik.newPhoto({"id":8760161,"src":"0101_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760161.html","width":130,"caption":"","height":98});
															thumbnails[8760162] = clik.newPhoto({"id":8760162,"src":"011_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760162.html","width":130,"caption":"","height":98});
															thumbnails[8760163] = clik.newPhoto({"id":8760163,"src":"012_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760163.html","width":130,"caption":"","height":86});
															thumbnails[8760164] = clik.newPhoto({"id":8760164,"src":"013_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8760164.html","width":130,"caption":"","height":95});
															thumbnails[8773007] = clik.newPhoto({"id":8773007,"src":"21st-may-2010-001_thumb.jpg","galleries_id":283238,"server_id":18,"link":"photo_8773007.html","width":130,"caption":"","height":98});
															thumbnails[8773009] = clik.newPhoto({"id":8773009,"src":"21st-may-2010-004_thumb.jpg","galleries_id":283238,"server_id":18,"link":"photo_8773009.html","width":130,"caption":"","height":173});
															thumbnails[8785545] = clik.newPhoto({"id":8785545,"src":"white_elephant_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_8785545.html","width":130,"caption":"White Elephant","height":173});
															thumbnails[8785547] = clik.newPhoto({"id":8785547,"src":"white_plume_thumb.jpg","galleries_id":283239,"server_id":18,"link":"photo_8785547.html","width":130,"caption":"White Plume","height":173});
															thumbnails[8789813] = clik.newPhoto({"id":8789813,"src":"poor_tom_001_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8789813.html","width":130,"caption":"Poor Tom","height":171});
															thumbnails[8789814] = clik.newPhoto({"id":8789814,"src":"poor_tom_002_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8789814.html","width":130,"caption":"Cockerel","height":181});
															thumbnails[8789816] = clik.newPhoto({"id":8789816,"src":"poor_tom_003_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8789816.html","width":130,"caption":"Walcheren","height":174});
															thumbnails[8789818] = clik.newPhoto({"id":8789818,"src":"poor_tom_004_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8789818.html","width":130,"caption":"In the Camelias","height":175});
															thumbnails[8789823] = clik.newPhoto({"id":8789823,"src":"poor_tom_005_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8789823.html","width":130,"caption":"Rufus 2","height":171});
															thumbnails[8789876] = clik.newPhoto({"id":8789876,"src":"poor_tom_006_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8789876.html","width":130,"caption":"Life drawing 1","height":162});
															thumbnails[8789903] = clik.newPhoto({"id":8789903,"src":"poor_tom_007_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8789903.html","width":130,"caption":"Life drawing 2","height":183});
															thumbnails[8789904] = clik.newPhoto({"id":8789904,"src":"poor_tom_008_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8789904.html","width":130,"caption":"The Twins","height":173});
															thumbnails[8789905] = clik.newPhoto({"id":8789905,"src":"poor_tom_009_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8789905.html","width":130,"caption":"In the Bloodstream","height":181});
															thumbnails[8827388] = clik.newPhoto({"id":8827388,"src":"002_40C0D7E7-1E4F-37DC-71E5D225F9A64137_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8827388.html","width":130,"caption":"In the Dark Australia","height":106});
															thumbnails[8827389] = clik.newPhoto({"id":8827389,"src":"001_40CB22AF-1E4F-37DC-71178A708BFF1393_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8827389.html","width":130,"caption":"Fields of Athenry","height":112});
															thumbnails[8827390] = clik.newPhoto({"id":8827390,"src":"0041_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_8827390.html","width":130,"caption":"Marco Polo","height":111});
															thumbnails[8857815] = clik.newPhoto({"id":8857815,"src":"005_9369189D-24E8-5EC4-4F83C90A5E949111_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8857815.html","width":130,"caption":"May 10th 1941","height":189});
															thumbnails[8857818] = clik.newPhoto({"id":8857818,"src":"0062_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8857818.html","width":130,"caption":"Synapse","height":178});
															thumbnails[8857832] = clik.newPhoto({"id":8857832,"src":"0072_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8857832.html","width":130,"caption":"The Beanfield","height":166});
															thumbnails[8857847] = clik.newPhoto({"id":8857847,"src":"0082_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8857847.html","width":130,"caption":"In the Rough","height":177});
															thumbnails[8857849] = clik.newPhoto({"id":8857849,"src":"0091_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8857849.html","width":130,"caption":"Road to Mandalay","height":167});
															thumbnails[8861975] = clik.newPhoto({"id":8861975,"src":"0021_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8861975.html","width":130,"caption":"Fireline - Canal Triptych","height":129});
															thumbnails[8862003] = clik.newPhoto({"id":8862003,"src":"0032_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8862003.html","width":130,"caption":"Waterline - Canal Triptych","height":128});
															thumbnails[8862020] = clik.newPhoto({"id":8862020,"src":"004_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8862020.html","width":130,"caption":"Caen","height":173});
															thumbnails[8947135] = clik.newPhoto({"id":8947135,"src":"003_74708925-1EC9-DFB6-09D4F53E85217030_thumb.JPG","galleries_id":283238,"server_id":18,"link":"photo_8947135.html","width":130,"caption":"Figures in a Landscape (winter)","height":119});
															thumbnails[9046022] = clik.newPhoto({"id":9046022,"src":"001_4A28A100-1EC9-D45B-1CAA199F7BE51E69_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_9046022.html","width":130,"caption":"","height":120});
															thumbnails[9046024] = clik.newPhoto({"id":9046024,"src":"003_4A327313-1EC9-D45B-1C80966EE8A38252_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_9046024.html","width":130,"caption":"","height":129});
															thumbnails[9046026] = clik.newPhoto({"id":9046026,"src":"001_4A3848F1-1EC9-D45B-1C89EAF626CCE367_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_9046026.html","width":130,"caption":"","height":148});
															thumbnails[9046027] = clik.newPhoto({"id":9046027,"src":"001_4A3ECDB8-1EC9-D45B-1C739A210BBE299E_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_9046027.html","width":130,"caption":"","height":130});
															thumbnails[9076360] = clik.newPhoto({"id":9076360,"src":"004_D7BB4D50-1EC9-D45B-1C758EA0CC94D917_thumb.JPG","galleries_id":283239,"server_id":18,"link":"photo_9076360.html","width":130,"caption":"","height":126});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[283238] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1","link":"gallery_283238.html","maxRecords":0.0,"photoIDs":[4985870.0,4985874.0,4985891.0,4985929.0,4985935.0,4985945.0,4985950.0,4985953.0,4985956.0,4991568.0,5141126.0,5141144.0,5141147.0,5141151.0,6575256.0,6575267.0,6575377.0,8760142.0,8760146.0,8760148.0,8773007.0,8773009.0,8789813.0,8789814.0,8789816.0,8789818.0,8789823.0,8789876.0,8789903.0,8789904.0,8789905.0,8857815.0,8857818.0,8857832.0,8857847.0,8857849.0,8861975.0,8862003.0,8862020.0,8947135.0],"skipIndex":0,"section_code":"gallery","featured_images":"8947135,8862020,8862003,8861975,8857849,8857847,8857832,8857818,8857815,8789905","id":283238,"singleSection":false});				  						galleries[283239] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 2","link":"gallery_283239.html","maxRecords":0.0,"photoIDs":[4991582.0,4991583.0,4991588.0,4991594.0,4991595.0,4991598.0,5731902.0,5748976.0,5749031.0,5749051.0,5749116.0,5808310.0,6575387.0,6575396.0,6575401.0,6575406.0,6575410.0,6603427.0,6603428.0,6603433.0,6734667.0,6744358.0,6744360.0,6944688.0,6944701.0,8626030.0,8635964.0,8760150.0,8760151.0,8760153.0,8760154.0,8760155.0,8760156.0,8760157.0,8760158.0,8760159.0,8760160.0,8760161.0,8760162.0,8760163.0,8760164.0,8785545.0,8785547.0,8827388.0,8827389.0,8827390.0,9046022.0,9046024.0,9046026.0,9046027.0,9076360.0],"skipIndex":0,"section_code":"gallery","featured_images":"9076360,9046027,9046026,9046024,9046022,8827390,8827389,8827388,8785547,8785545","id":283239,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9076360,9046027,9046026,9046024,9046022,8947135,8862020,8862003,8861975,8857849,8857847,8857832,8857818,8857815,8827390,8827389,8827388,8789905,8789904,8789903,8789876,8789823,8789818,8789816,8789814,8789813,8785621,8785547,8785545,8773009,8773007,8773001,8760164,8760163,8760162,8760161,8760160,8760159,8760158,8760157,8760156,8760155,8760154,8760153,8760151,8760150,8760148,8760146,8760142,8635964';
imageSets[3] = '9076360,9046027,9046026,9046024,9046022,8947135,8862020,8862003,8861975,8857849,8857847,8857832,8857818,8857815,8827390,8827389,8827388,8789905,8789904,8789903,8789876,8789823,8789818,8789816,8789814,8789813,8785621,8785547,8785545,8773009,8773007,8773001,8760164,8760163,8760162,8760161,8760160,8760159,8760158,8760157,8760156,8760155,8760154,8760153,8760151,8760150,8760148,8760146,8760142,8635964';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/chrislessware/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/chrislessware/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 = 'Chris Lessware paintings: ' + 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;
	}
}

			

