window.thumbnails = {};
															thumbnails[957517] = clik.newPhoto({"id":957517,"src":"Hanbury221.jpg","galleries_id":22802,"server_id":18,"link":"photo_957517.html","width":130,"caption":"Misty Worcestershire","height":87});
															thumbnails[957521] = clik.newPhoto({"id":957521,"src":"Hanbury11.jpg","galleries_id":22802,"server_id":18,"link":"photo_957521.html","width":130,"caption":"View of Madams Hill","height":80});
															thumbnails[1454365] = clik.newPhoto({"id":1454365,"src":"poldhu151.jpg","galleries_id":22802,"server_id":18,"link":"photo_1454365.html","width":130,"caption":"poldhu Cove","height":86});
															thumbnails[1856710] = clik.newPhoto({"id":1856710,"src":"Woodrowpool7_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_1856710.html","width":130,"caption":"Woodrow Pool","height":87});
															thumbnails[1858007] = clik.newPhoto({"id":1858007,"src":"Woodrowpool1_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_1858007.html","width":130,"caption":"Woodrow pool","height":87});
															thumbnails[2403633] = clik.newPhoto({"id":2403633,"src":"Shaldon Beach3_thumb.jpg","galleries_id":155351,"server_id":18,"link":"photo_2403633.html","width":130,"caption":"Shaldon Beach","height":102});
															thumbnails[2907801] = clik.newPhoto({"id":2907801,"src":"Shell ford_thumb.jpg","galleries_id":155351,"server_id":18,"link":"photo_2907801.html","width":130,"caption":"Stone footbridge ","height":104});
															thumbnails[2931256] = clik.newPhoto({"id":2931256,"src":"Hanbury1_1_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_2931256.html","width":130,"caption":"View from Hanbury Church","height":86});
															thumbnails[2931265] = clik.newPhoto({"id":2931265,"src":"Shell River_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_2931265.html","width":130,"caption":"Bow Brook","height":86});
															thumbnails[3279298] = clik.newPhoto({"id":3279298,"src":"Diglis_Marina_2007_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_3279298.html","width":130,"caption":"Diglis Canal Basin 2007","height":87});
															thumbnails[3418017] = clik.newPhoto({"id":3418017,"src":"Knightwick Church_thumb.jpg","galleries_id":155351,"server_id":18,"link":"photo_3418017.html","width":130,"caption":"Knightwick Church","height":104});
															thumbnails[3765010] = clik.newPhoto({"id":3765010,"src":"Farm_truck_thumb.jpg","galleries_id":155351,"server_id":18,"link":"photo_3765010.html","width":130,"caption":"Farm truck","height":103});
															thumbnails[4896568] = clik.newPhoto({"id":4896568,"src":"wedding7_thumb.jpg","galleries_id":278542,"server_id":18,"link":"photo_4896568.html","width":130,"caption":"","height":185});
															thumbnails[4931027] = clik.newPhoto({"id":4931027,"src":"wedding8_thumb.jpg","galleries_id":278542,"server_id":18,"link":"photo_4931027.html","width":130,"caption":"","height":243});
															thumbnails[5335695] = clik.newPhoto({"id":5335695,"src":"Avoncroftwindmill6_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_5335695.html","width":130,"caption":"Danzey Green Windmill in winter","height":97});
															thumbnails[5395848] = clik.newPhoto({"id":5395848,"src":"Conwy-Estuary1_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_5395848.html","width":130,"caption":"Sunset on the Conwy Estuary","height":107});
															thumbnails[5395857] = clik.newPhoto({"id":5395857,"src":"Sunset_canal_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_5395857.html","width":130,"caption":"Birmingham and Worcester canal at sunset","height":195});
															thumbnails[5480968] = clik.newPhoto({"id":5480968,"src":"Oak_at_Stoke_Pound_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_5480968.html","width":130,"caption":"Oak at Stoke Pound","height":87});
															thumbnails[5535461] = clik.newPhoto({"id":5535461,"src":"cornwall1_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_5535461.html","width":130,"caption":"Polruan Cove","height":195});
															thumbnails[5721729] = clik.newPhoto({"id":5721729,"src":"Face_thumb.jpg","galleries_id":155351,"server_id":18,"link":"photo_5721729.html","width":130,"caption":"The face","height":104});
															thumbnails[5721730] = clik.newPhoto({"id":5721730,"src":"oak-roof_thumb.jpg","galleries_id":155351,"server_id":18,"link":"photo_5721730.html","width":130,"caption":"Oak roof detail","height":87});
															thumbnails[5965850] = clik.newPhoto({"id":5965850,"src":"0088_thumb.jpg","galleries_id":278542,"server_id":18,"link":"photo_5965850.html","width":130,"caption":"","height":184});
															thumbnails[5965930] = clik.newPhoto({"id":5965930,"src":"0089_thumb.jpg","galleries_id":278542,"server_id":18,"link":"photo_5965930.html","width":130,"caption":"","height":108});
															thumbnails[6050733] = clik.newPhoto({"id":6050733,"src":"cornwall3_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_6050733.html","width":130,"caption":"Storm Cornwall","height":87});
															thumbnails[6095132] = clik.newPhoto({"id":6095132,"src":"Cardoon_thumb.jpg","galleries_id":22875,"server_id":18,"link":"photo_6095132.html","width":130,"caption":"Cardoon Leaf B&W","height":87});
															thumbnails[6095138] = clik.newPhoto({"id":6095138,"src":"Poppy_after_rain_thumb.jpg","galleries_id":22875,"server_id":18,"link":"photo_6095138.html","width":130,"caption":"Poppy after rain","height":87});
															thumbnails[6116785] = clik.newPhoto({"id":6116785,"src":"0067_thumb.jpg","galleries_id":278542,"server_id":18,"link":"photo_6116785.html","width":130,"caption":"","height":182});
															thumbnails[6116796] = clik.newPhoto({"id":6116796,"src":"0090_thumb.jpg","galleries_id":278542,"server_id":18,"link":"photo_6116796.html","width":130,"caption":"","height":195});
															thumbnails[6116902] = clik.newPhoto({"id":6116902,"src":"_MG_2583-01_thumb.jpg","galleries_id":278542,"server_id":18,"link":"photo_6116902.html","width":130,"caption":"","height":87});
															thumbnails[6180791] = clik.newPhoto({"id":6180791,"src":"cardoon-leaf_thumb.jpg","galleries_id":155351,"server_id":18,"link":"photo_6180791.html","width":130,"caption":"Cardoon leaf detail","height":195});
															thumbnails[6204585] = clik.newPhoto({"id":6204585,"src":"Dead_Truck_thumb.jpg","galleries_id":155351,"server_id":18,"link":"photo_6204585.html","width":130,"caption":"Dead Truck","height":101});
															thumbnails[6204614] = clik.newPhoto({"id":6204614,"src":"Church_Arch_thumb.jpg","galleries_id":155351,"server_id":18,"link":"photo_6204614.html","width":130,"caption":"Church Arch Detail","height":114});
															thumbnails[6469677] = clik.newPhoto({"id":6469677,"src":"Burnet-moth_thumb.jpg","galleries_id":22875,"server_id":18,"link":"photo_6469677.html","width":130,"caption":"Five Spot Burnet Moth","height":195});
															thumbnails[6469752] = clik.newPhoto({"id":6469752,"src":"Metalwork-detail2_thumb.jpg","galleries_id":356619,"server_id":18,"link":"photo_6469752.html","width":130,"caption":"Metalwork Detail","height":101});
															thumbnails[6521140] = clik.newPhoto({"id":6521140,"src":"img011_thumb.jpg","galleries_id":356619,"server_id":18,"link":"photo_6521140.html","width":130,"caption":"Metal bracket smothered with Ivy","height":101});
															thumbnails[6521168] = clik.newPhoto({"id":6521168,"src":"img015_thumb.jpg","galleries_id":356619,"server_id":18,"link":"photo_6521168.html","width":130,"caption":"Metal door brackets","height":101});
															thumbnails[6521173] = clik.newPhoto({"id":6521173,"src":"img022_thumb.jpg","galleries_id":356619,"server_id":18,"link":"photo_6521173.html","width":130,"caption":"Door detail","height":101});
															thumbnails[6539088] = clik.newPhoto({"id":6539088,"src":"Metalworkdetail1_thumb.jpg","galleries_id":356619,"server_id":18,"link":"photo_6539088.html","width":130,"caption":"Metalwork Detail","height":143});
															thumbnails[6812116] = clik.newPhoto({"id":6812116,"src":"Fishing_village11_thumb.jpg","galleries_id":370161,"server_id":18,"link":"photo_6812116.html","width":160,"caption":"Greek fishing Village panoramic","height":62});
															thumbnails[6824776] = clik.newPhoto({"id":6824776,"src":"Hanbury_Pano1_thumb.jpg","galleries_id":370161,"server_id":18,"link":"photo_6824776.html","width":150,"caption":"Winter Sunrise Hanbury","height":55});
															thumbnails[6824910] = clik.newPhoto({"id":6824910,"src":"Martley_Pano3_thumb.jpg","galleries_id":370161,"server_id":18,"link":"photo_6824910.html","width":150,"caption":"Sunrise Martley","height":60});
															thumbnails[6837744] = clik.newPhoto({"id":6837744,"src":"Ern_BlackWhite_thumb.jpg","galleries_id":371326,"server_id":18,"link":"photo_6837744.html","width":130,"caption":"Greek Ern","height":87});
															thumbnails[6837756] = clik.newPhoto({"id":6837756,"src":"Austin_Masct_thumb.jpg","galleries_id":371326,"server_id":18,"link":"photo_6837756.html","width":130,"caption":"Austin Mascot","height":87});
															thumbnails[6837768] = clik.newPhoto({"id":6837768,"src":"Mascot1_thumb.jpg","galleries_id":371326,"server_id":18,"link":"photo_6837768.html","width":130,"caption":"Alvis Mascot","height":195});
															thumbnails[6841865] = clik.newPhoto({"id":6841865,"src":"Orchid1_thumb.jpg","galleries_id":22875,"server_id":18,"link":"photo_6841865.html","width":130,"caption":"Orchid","height":195});
															thumbnails[7169147] = clik.newPhoto({"id":7169147,"src":"winter1_thumb.jpg","galleries_id":387382,"server_id":18,"link":"photo_7169147.html","width":150,"caption":"Orchard winter","height":100});
															thumbnails[7169149] = clik.newPhoto({"id":7169149,"src":"winter2_thumb.jpg","galleries_id":387382,"server_id":18,"link":"photo_7169149.html","width":150,"caption":"","height":100});
															thumbnails[7169150] = clik.newPhoto({"id":7169150,"src":"winter3_thumb.jpg","galleries_id":387382,"server_id":18,"link":"photo_7169150.html","width":150,"caption":"","height":100});
															thumbnails[7169152] = clik.newPhoto({"id":7169152,"src":"winter4_thumb.jpg","galleries_id":387382,"server_id":18,"link":"photo_7169152.html","width":150,"caption":"","height":225});
															thumbnails[7177066] = clik.newPhoto({"id":7177066,"src":"winter8_thumb.jpg","galleries_id":387382,"server_id":18,"link":"photo_7177066.html","width":150,"caption":"","height":100});
															thumbnails[7226575] = clik.newPhoto({"id":7226575,"src":"0498_thumb.jpg","galleries_id":387382,"server_id":18,"link":"photo_7226575.html","width":150,"caption":"Orchard Winter","height":97});
															thumbnails[7711666] = clik.newPhoto({"id":7711666,"src":"Railwaywagon1_thumb.jpg","galleries_id":356619,"server_id":18,"link":"photo_7711666.html","width":150,"caption":"Goods Waggon","height":116});
															thumbnails[7711726] = clik.newPhoto({"id":7711726,"src":"Railwaywagon2_thumb.jpg","galleries_id":356619,"server_id":18,"link":"photo_7711726.html","width":150,"caption":"Goods waggon detail","height":115});
															thumbnails[8074739] = clik.newPhoto({"id":8074739,"src":"Scotland1_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_8074739.html","width":150,"caption":"Tighnabruaich sunrise","height":100});
															thumbnails[8074747] = clik.newPhoto({"id":8074747,"src":"Scotland2_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_8074747.html","width":150,"caption":"Sunrise sea shore","height":100});
															thumbnails[8160400] = clik.newPhoto({"id":8160400,"src":"Scotland3_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_8160400.html","width":150,"caption":"Shore sunrise","height":100});
															thumbnails[8647965] = clik.newPhoto({"id":8647965,"src":"spring_sunrise_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_8647965.html","width":150,"caption":"Oak Tree Sunrise","height":111});
															thumbnails[8866179] = clik.newPhoto({"id":8866179,"src":"cornwall5_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_8866179.html","width":150,"caption":"Winter sunset on a Cornish beach ","height":225});
															thumbnails[8871240] = clik.newPhoto({"id":8871240,"src":"Scotland1_04D5FEFB-1E4F-37DC-71E2544870421058_thumb.jpg","galleries_id":22875,"server_id":18,"link":"photo_8871240.html","width":150,"caption":"Loch Shore","height":100});
															thumbnails[8871245] = clik.newPhoto({"id":8871245,"src":"Scotland2_0501A353-1E4F-37DC-71E24C08557BC542_thumb.jpg","galleries_id":371326,"server_id":18,"link":"photo_8871245.html","width":150,"caption":"Brick Arch","height":225});
															thumbnails[8871249] = clik.newPhoto({"id":8871249,"src":"San_Francisco1_thumb.jpg","galleries_id":371326,"server_id":18,"link":"photo_8871249.html","width":150,"caption":"Hyde Street, San Francisco","height":225});
															thumbnails[8898288] = clik.newPhoto({"id":8898288,"src":"sunrise1_thumb.jpg","galleries_id":370161,"server_id":18,"link":"photo_8898288.html","width":150,"caption":"Scotland sunrise","height":76});
															thumbnails[8898311] = clik.newPhoto({"id":8898311,"src":"Japanese_Tea_Garden_thumb.jpg","galleries_id":371326,"server_id":18,"link":"photo_8898311.html","width":150,"caption":"Japanese Tea Gardens","height":100});
															thumbnails[8898330] = clik.newPhoto({"id":8898330,"src":"Fishing_boat_Greece_thumb.jpg","galleries_id":371326,"server_id":18,"link":"photo_8898330.html","width":150,"caption":"Fishing Boat ","height":100});
															thumbnails[8898345] = clik.newPhoto({"id":8898345,"src":"Flowers1_thumb.jpg","galleries_id":22875,"server_id":18,"link":"photo_8898345.html","width":150,"caption":"Garden Flowers","height":100});
															thumbnails[9059123] = clik.newPhoto({"id":9059123,"src":"Weethley_Church_thumb.jpg","galleries_id":371326,"server_id":18,"link":"photo_9059123.html","width":150,"caption":"Weethley Church","height":100});
															thumbnails[619800] = clik.newPhoto({"id":619800,"src":"Maple21.jpg","galleries_id":22875,"server_id":18,"link":"photo_619800.html","width":130,"caption":"Autumn Colour","height":195});
															thumbnails[2218861] = clik.newPhoto({"id":2218861,"src":"IMG_0433_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_2218861.html","width":130,"caption":"Diglis Marina 2006","height":87});
															thumbnails[2219915] = clik.newPhoto({"id":2219915,"src":"IMG_04672_thumb.jpg","galleries_id":356630,"server_id":18,"link":"photo_2219915.html","width":130,"caption":"Cedar wood bungalow","height":87});
															thumbnails[598899] = clik.newPhoto({"id":598899,"src":"Maple12.jpg","galleries_id":22875,"server_id":18,"link":"photo_598899.html","width":130,"caption":"Autumn Colour","height":87});
															thumbnails[5395798] = clik.newPhoto({"id":5395798,"src":"Avoncroftwindmill2_thumb.jpg","galleries_id":22802,"server_id":18,"link":"photo_5395798.html","width":130,"caption":"Danzey Green Windmill","height":195});
															thumbnails[2218858] = clik.newPhoto({"id":2218858,"src":"IMG_0426_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_2218858.html","width":130,"caption":"Diglis Marina 2006","height":87});
															thumbnails[2219924] = clik.newPhoto({"id":2219924,"src":"IMG_0469_thumb.jpg","galleries_id":356630,"server_id":18,"link":"photo_2219924.html","width":130,"caption":"Cedar wood bungalow","height":87});
															thumbnails[252394] = clik.newPhoto({"id":252394,"src":"stokecanaltest22.jpg","galleries_id":22802,"server_id":18,"link":"photo_252394.html","width":130,"caption":"Lock on the Canal","height":78});
															thumbnails[2218963] = clik.newPhoto({"id":2218963,"src":"_MG_2909_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_2218963.html","width":130,"caption":"Work in progress","height":87});
															thumbnails[2219930] = clik.newPhoto({"id":2219930,"src":"IMG_0470_thumb.jpg","galleries_id":356630,"server_id":18,"link":"photo_2219930.html","width":130,"caption":"Cedar wood Bungalows","height":87});
															thumbnails[3279283] = clik.newPhoto({"id":3279283,"src":"Diglis5_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_3279283.html","width":130,"caption":"Regeneration ","height":77});
															thumbnails[2218471] = clik.newPhoto({"id":2218471,"src":"_MG_3273_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_2218471.html","width":130,"caption":"Diglis Marina","height":87});
															thumbnails[2218867] = clik.newPhoto({"id":2218867,"src":"_MG_3275_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_2218867.html","width":130,"caption":"Diglis Canal Basin","height":87});
															thumbnails[2288124] = clik.newPhoto({"id":2288124,"src":"DiglisBasinB&W2_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_2288124.html","width":130,"caption":"Diglis Canal Basin","height":87});
															thumbnails[3366904] = clik.newPhoto({"id":3366904,"src":"Diglis Canal basin_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_3366904.html","width":130,"caption":"New flats at Diglis Basin","height":87});
															thumbnails[2223168] = clik.newPhoto({"id":2223168,"src":"Diglis Basin_thumb.jpg","galleries_id":146427,"server_id":18,"link":"photo_2223168.html","width":130,"caption":"Diglis Canal Basin","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[371326] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Odds n Ends","link":"gallery_371326.html","maxRecords":0.0,"photoIDs":[6837744.0,6837756.0,6837768.0,8871245.0,8871249.0,8898311.0,8898330.0,9059123.0],"skipIndex":0,"section_code":"gallery","featured_images":6837744.0,"id":371326,"singleSection":false});				  						galleries[155351] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Large Format ","link":"gallery_155351.html","maxRecords":0.0,"photoIDs":[2403633.0,2907801.0,3418017.0,3765010.0,5721729.0,5721730.0,6180791.0,6204585.0,6204614.0],"skipIndex":0,"section_code":"gallery","featured_images":2403633.0,"id":155351,"singleSection":false});				  						galleries[146427] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Diglis Canal Basin Project","link":"gallery_146427.html","maxRecords":0.0,"photoIDs":[3279298.0,2218861.0,2218858.0,2218963.0,3279283.0,2218471.0,2218867.0,2288124.0,3366904.0,2223168.0],"skipIndex":0,"section_code":"gallery","featured_images":2218861.0,"id":146427,"singleSection":false});				  						galleries[356619] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"British Rail Goods Wagons Project","link":"gallery_356619.html","maxRecords":0.0,"photoIDs":[6469752.0,6521140.0,6521168.0,6521173.0,6539088.0,7711666.0,7711726.0],"skipIndex":0,"section_code":"gallery","featured_images":6521173.0,"id":356619,"singleSection":false});				  						galleries[356630] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Austin Village Project","link":"gallery_356630.html","maxRecords":0.0,"photoIDs":[2219915.0,2219924.0,2219930.0],"skipIndex":0,"section_code":"gallery","featured_images":2219915.0,"id":356630,"singleSection":false});				  						galleries[370161] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Panoramic","link":"gallery_370161.html","maxRecords":0.0,"photoIDs":[6812116.0,6824776.0,6824910.0,8898288.0],"skipIndex":0,"section_code":"gallery","featured_images":6824776.0,"id":370161,"singleSection":false});				  						galleries[22875] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Nature","link":"gallery_22875.html","maxRecords":0.0,"photoIDs":[6095132.0,6095138.0,6469677.0,6841865.0,8871240.0,8898345.0,619800.0,598899.0],"skipIndex":0,"section_code":"gallery","featured_images":598899.0,"id":22875,"singleSection":false});				  						galleries[278542] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_278542.html","maxRecords":0.0,"photoIDs":[4896568.0,4931027.0,5965850.0,5965930.0,6116785.0,6116796.0,6116902.0],"skipIndex":0,"section_code":"gallery","featured_images":4896568.0,"id":278542,"singleSection":false});				  						galleries[22802] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_22802.html","maxRecords":0.0,"photoIDs":[957517.0,957521.0,1454365.0,1856710.0,1858007.0,2931256.0,2931265.0,5335695.0,5395848.0,5395857.0,5480968.0,5535461.0,6050733.0,8074739.0,8074747.0,8160400.0,8647965.0,8866179.0,5395798.0,252394.0],"skipIndex":0,"section_code":"gallery","featured_images":"8866179,8647965,8160400,8074747,8074739,6050733,5535461,5480968,5395857,5395848","id":22802,"singleSection":false});				  						galleries[387382] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Winter 2010","link":"gallery_387382.html","maxRecords":0.0,"photoIDs":[7169147.0,7169149.0,7169150.0,7169152.0,7177066.0,7226575.0],"skipIndex":0,"section_code":"gallery","featured_images":"7226575,7177066,7169152,7169150,7169149,7169147","id":387382,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7226575';
imageSets[2] = '6837744,6824776,6521173,4896568,2403633,2219915,2218861,598899';
imageSets[3] = '7177066,4896568,2907801';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/tonylee/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/tonylee/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/tonylee/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/tonylee/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/tonylee/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/tonylee/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/tonylee/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/tonylee/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 = 'Tony Lee Images: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
	temp += this.fnGetPaymentInfo();
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp += '<p>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.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="tony.lee2@tesco.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="tony.lee2@tesco.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;
	}
}

			

