window.thumbnails = {};
															thumbnails[2155194] = clik.newPhoto({"id":2155194,"src":"47 120 RAF KINLOSS WEB PAGE_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"47120 RAF Kinloss at Inverness on the 10th June 1985. David Hills","height":87});
															thumbnails[6411257] = clik.newPhoto({"id":6411257,"src":"Oakglen_Railroad_1_thumb.JPG","galleries_id":349772,"server_id":32,"link":"photo_6411257.html","width":130,"caption":"","height":87});
															thumbnails[6411258] = clik.newPhoto({"id":6411258,"src":"Oakglen_Railroad_2_thumb.JPG","galleries_id":349772,"server_id":32,"link":"photo_6411258.html","width":130,"caption":"","height":87});
															thumbnails[6411262] = clik.newPhoto({"id":6411262,"src":"Oakglen_Railroad_3_thumb.JPG","galleries_id":349772,"server_id":32,"link":"photo_6411262.html","width":130,"caption":"","height":87});
															thumbnails[6411264] = clik.newPhoto({"id":6411264,"src":"Oakglen_Railroad_4_thumb.JPG","galleries_id":349772,"server_id":32,"link":"photo_6411264.html","width":130,"caption":"","height":87});
															thumbnails[6411265] = clik.newPhoto({"id":6411265,"src":"Oakglen_Railroad_5_thumb.JPG","galleries_id":349772,"server_id":32,"link":"photo_6411265.html","width":130,"caption":"","height":87});
															thumbnails[6411266] = clik.newPhoto({"id":6411266,"src":"Oakglen_Railroad_6_thumb.JPG","galleries_id":349772,"server_id":32,"link":"photo_6411266.html","width":130,"caption":"","height":87});
															thumbnails[6411267] = clik.newPhoto({"id":6411267,"src":"Oakglen_Railroad_7_thumb.JPG","galleries_id":349772,"server_id":32,"link":"photo_6411267.html","width":130,"caption":"","height":87});
															thumbnails[6411269] = clik.newPhoto({"id":6411269,"src":"Oakglen_Railroad_8_thumb.JPG","galleries_id":349772,"server_id":32,"link":"photo_6411269.html","width":130,"caption":"","height":87});
															thumbnails[6411270] = clik.newPhoto({"id":6411270,"src":"Oakglen_Railroad_9_thumb.JPG","galleries_id":349772,"server_id":32,"link":"photo_6411270.html","width":130,"caption":"","height":87});
															thumbnails[2204583] = clik.newPhoto({"id":2204583,"src":"AY (4)_thumb.JPG","galleries_id":142791,"server_id":32,"link":"photo_2204583.html","width":130,"caption":"","height":87});
															thumbnails[2236446] = clik.newPhoto({"id":2236446,"src":"Claughton works1_thumb.JPG","galleries_id":145650,"server_id":32,"link":"photo_2236446.html","width":130,"caption":"","height":195});
															thumbnails[2984766] = clik.newPhoto({"id":2984766,"src":"NP (2)_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_2984766.html","width":130,"caption":"","height":87});
															thumbnails[2984783] = clik.newPhoto({"id":2984783,"src":"CG (1)1_thumb.jpg","galleries_id":142792,"server_id":32,"link":"photo_2984783.html","width":130,"caption":"","height":87});
															thumbnails[2204590] = clik.newPhoto({"id":2204590,"src":"AY (8)_thumb.JPG","galleries_id":142791,"server_id":32,"link":"photo_2204590.html","width":130,"caption":"","height":87});
															thumbnails[2236447] = clik.newPhoto({"id":2236447,"src":"Claughton works2_thumb.JPG","galleries_id":145650,"server_id":32,"link":"photo_2236447.html","width":130,"caption":"","height":195});
															thumbnails[2984778] = clik.newPhoto({"id":2984778,"src":"NP (3)_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_2984778.html","width":130,"caption":"","height":87});
															thumbnails[2984784] = clik.newPhoto({"id":2984784,"src":"CG (2)1_thumb.jpg","galleries_id":142792,"server_id":32,"link":"photo_2984784.html","width":130,"caption":"","height":87});
															thumbnails[2204585] = clik.newPhoto({"id":2204585,"src":"AY (5)_thumb.JPG","galleries_id":142791,"server_id":32,"link":"photo_2204585.html","width":130,"caption":"","height":87});
															thumbnails[2236461] = clik.newPhoto({"id":2236461,"src":"Claughton Works13_thumb.JPG","galleries_id":145650,"server_id":32,"link":"photo_2236461.html","width":130,"caption":"","height":173});
															thumbnails[2984785] = clik.newPhoto({"id":2984785,"src":"CG (3)1_thumb.jpg","galleries_id":142792,"server_id":32,"link":"photo_2984785.html","width":130,"caption":"","height":87});
															thumbnails[3578459] = clik.newPhoto({"id":3578459,"src":"DSC_0240_239_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_3578459.html","width":130,"caption":"","height":87});
															thumbnails[2204580] = clik.newPhoto({"id":2204580,"src":"AY (2)_thumb.JPG","galleries_id":142791,"server_id":32,"link":"photo_2204580.html","width":130,"caption":"","height":87});
															thumbnails[2236454] = clik.newPhoto({"id":2236454,"src":"Claughton Works11_thumb.JPG","galleries_id":145650,"server_id":32,"link":"photo_2236454.html","width":130,"caption":"","height":87});
															thumbnails[2984790] = clik.newPhoto({"id":2984790,"src":"CG (8)1_thumb.jpg","galleries_id":142792,"server_id":32,"link":"photo_2984790.html","width":130,"caption":"","height":87});
															thumbnails[3578456] = clik.newPhoto({"id":3578456,"src":"DSC_0239_238_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_3578456.html","width":130,"caption":"","height":87});
															thumbnails[2204582] = clik.newPhoto({"id":2204582,"src":"AY (3)_thumb.JPG","galleries_id":142791,"server_id":32,"link":"photo_2204582.html","width":130,"caption":"","height":87});
															thumbnails[2236453] = clik.newPhoto({"id":2236453,"src":"Claughton Works10_thumb.JPG","galleries_id":145650,"server_id":32,"link":"photo_2236453.html","width":130,"caption":"","height":87});
															thumbnails[2984792] = clik.newPhoto({"id":2984792,"src":"CG (9)1_thumb.jpg","galleries_id":142792,"server_id":32,"link":"photo_2984792.html","width":130,"caption":"","height":87});
															thumbnails[3578471] = clik.newPhoto({"id":3578471,"src":"DSC_0237_236_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_3578471.html","width":130,"caption":"","height":87});
															thumbnails[2204589] = clik.newPhoto({"id":2204589,"src":"AY (7)_thumb.JPG","galleries_id":142791,"server_id":32,"link":"photo_2204589.html","width":130,"caption":"","height":87});
															thumbnails[2236449] = clik.newPhoto({"id":2236449,"src":"Claughton Works5_thumb.JPG","galleries_id":145650,"server_id":32,"link":"photo_2236449.html","width":130,"caption":"","height":87});
															thumbnails[2984788] = clik.newPhoto({"id":2984788,"src":"CG (6)1_thumb.jpg","galleries_id":142792,"server_id":32,"link":"photo_2984788.html","width":130,"caption":"","height":87});
															thumbnails[2204578] = clik.newPhoto({"id":2204578,"src":"AY (1)_thumb.JPG","galleries_id":142791,"server_id":32,"link":"photo_2204578.html","width":130,"caption":"","height":87});
															thumbnails[2236452] = clik.newPhoto({"id":2236452,"src":"Claughton Works9_thumb.JPG","galleries_id":145650,"server_id":32,"link":"photo_2236452.html","width":130,"caption":"","height":87});
															thumbnails[2984789] = clik.newPhoto({"id":2984789,"src":"CG (7)1_thumb.jpg","galleries_id":142792,"server_id":32,"link":"photo_2984789.html","width":130,"caption":"","height":87});
															thumbnails[4500649] = clik.newPhoto({"id":4500649,"src":"DSC03962_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_4500649.html","width":130,"caption":"","height":87});
															thumbnails[2204591] = clik.newPhoto({"id":2204591,"src":"AY (9)_thumb.JPG","galleries_id":142791,"server_id":32,"link":"photo_2204591.html","width":130,"caption":"","height":87});
															thumbnails[2236450] = clik.newPhoto({"id":2236450,"src":"Claughton Works6_thumb.JPG","galleries_id":145650,"server_id":32,"link":"photo_2236450.html","width":130,"caption":"","height":87});
															thumbnails[2984787] = clik.newPhoto({"id":2984787,"src":"CG (5)1_thumb.jpg","galleries_id":142792,"server_id":32,"link":"photo_2984787.html","width":130,"caption":"","height":87});
															thumbnails[4500652] = clik.newPhoto({"id":4500652,"src":"DSC03956_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_4500652.html","width":130,"caption":"","height":87});
															thumbnails[2204592] = clik.newPhoto({"id":2204592,"src":"AY (10)_thumb.JPG","galleries_id":142791,"server_id":32,"link":"photo_2204592.html","width":130,"caption":"","height":87});
															thumbnails[2236451] = clik.newPhoto({"id":2236451,"src":"Claughton Works7_thumb.JPG","galleries_id":145650,"server_id":32,"link":"photo_2236451.html","width":130,"caption":"","height":87});
															thumbnails[2984786] = clik.newPhoto({"id":2984786,"src":"CG (4)1_thumb.jpg","galleries_id":142792,"server_id":32,"link":"photo_2984786.html","width":130,"caption":"","height":87});
															thumbnails[4500643] = clik.newPhoto({"id":4500643,"src":"DSC03951_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_4500643.html","width":130,"caption":"","height":87});
															thumbnails[4500781] = clik.newPhoto({"id":4500781,"src":"DSC03948_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_4500781.html","width":130,"caption":"","height":87});
															thumbnails[5793709] = clik.newPhoto({"id":5793709,"src":"20100408_-_TS_1_thumb.JPG","galleries_id":183811,"server_id":32,"link":"photo_5793709.html","width":130,"caption":"","height":87});
															thumbnails[5793751] = clik.newPhoto({"id":5793751,"src":"20100408_-_TS_11_thumb.JPG","galleries_id":183811,"server_id":32,"link":"photo_5793751.html","width":130,"caption":"","height":87});
															thumbnails[4500786] = clik.newPhoto({"id":4500786,"src":"DSC03953_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_4500786.html","width":130,"caption":"","height":195});
															thumbnails[4500789] = clik.newPhoto({"id":4500789,"src":"DSC03946_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_4500789.html","width":130,"caption":"","height":195});
															thumbnails[5793719] = clik.newPhoto({"id":5793719,"src":"20100408_-_TS_5_thumb.JPG","galleries_id":183811,"server_id":32,"link":"photo_5793719.html","width":130,"caption":"","height":195});
															thumbnails[5793723] = clik.newPhoto({"id":5793723,"src":"20100408_-_TS_8_thumb.JPG","galleries_id":183811,"server_id":32,"link":"photo_5793723.html","width":130,"caption":"","height":195});
															thumbnails[5793717] = clik.newPhoto({"id":5793717,"src":"20100408_-_TS_4_thumb.JPG","galleries_id":183811,"server_id":32,"link":"photo_5793717.html","width":130,"caption":"","height":87});
															thumbnails[5793712] = clik.newPhoto({"id":5793712,"src":"20100408_-_TS_3_thumb.JPG","galleries_id":183811,"server_id":32,"link":"photo_5793712.html","width":130,"caption":"","height":87});
															thumbnails[5793720] = clik.newPhoto({"id":5793720,"src":"20100408_-_TS_6_thumb.JPG","galleries_id":183811,"server_id":32,"link":"photo_5793720.html","width":130,"caption":"","height":87});
															thumbnails[5793730] = clik.newPhoto({"id":5793730,"src":"20100408_-_TS_9_thumb.JPG","galleries_id":183811,"server_id":32,"link":"photo_5793730.html","width":130,"caption":"","height":87});
															thumbnails[5793732] = clik.newPhoto({"id":5793732,"src":"20100408_-_TS_15_thumb.JPG","galleries_id":183811,"server_id":32,"link":"photo_5793732.html","width":130,"caption":"","height":87});
															thumbnails[6399211] = clik.newPhoto({"id":6399211,"src":"DSC_0020_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_6399211.html","width":130,"caption":"","height":87});
															thumbnails[6399207] = clik.newPhoto({"id":6399207,"src":"DSC_0003_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_6399207.html","width":130,"caption":"","height":87});
															thumbnails[6399209] = clik.newPhoto({"id":6399209,"src":"DSC_0018_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_6399209.html","width":130,"caption":"","height":87});
															thumbnails[6399208] = clik.newPhoto({"id":6399208,"src":"DSC_0005_thumb.jpg","galleries_id":183811,"server_id":32,"link":"photo_6399208.html","width":130,"caption":"","height":87});
															thumbnails[8545553] = clik.newPhoto({"id":8545553,"src":"Railroad_1_thumb.jpg","galleries_id":463129,"server_id":32,"link":"photo_8545553.html","width":130,"caption":"","height":178});
															thumbnails[8545554] = clik.newPhoto({"id":8545554,"src":"Railroad_2_thumb.jpg","galleries_id":463129,"server_id":32,"link":"photo_8545554.html","width":130,"caption":"","height":101});
															thumbnails[8576552] = clik.newPhoto({"id":8576552,"src":"Railroad_4_thumb.jpg","galleries_id":463129,"server_id":32,"link":"photo_8576552.html","width":130,"caption":"","height":129});
															thumbnails[8576553] = clik.newPhoto({"id":8576553,"src":"Railroad_3_thumb.jpg","galleries_id":463129,"server_id":32,"link":"photo_8576553.html","width":130,"caption":"","height":65});
															thumbnails[2204601] = clik.newPhoto({"id":2204601,"src":"BC (5)_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_2204601.html","width":130,"caption":"","height":87});
															thumbnails[2204595] = clik.newPhoto({"id":2204595,"src":"BC (2)_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_2204595.html","width":130,"caption":"","height":87});
															thumbnails[2204602] = clik.newPhoto({"id":2204602,"src":"BC (6)_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_2204602.html","width":130,"caption":"","height":87});
															thumbnails[2204598] = clik.newPhoto({"id":2204598,"src":"BC (4)_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_2204598.html","width":130,"caption":"","height":87});
															thumbnails[2204604] = clik.newPhoto({"id":2204604,"src":"BC (7)_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_2204604.html","width":130,"caption":"","height":87});
															thumbnails[2204593] = clik.newPhoto({"id":2204593,"src":"BC (1)_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_2204593.html","width":130,"caption":"","height":87});
															thumbnails[2204609] = clik.newPhoto({"id":2204609,"src":"BC (9)_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_2204609.html","width":130,"caption":"","height":87});
															thumbnails[4692432] = clik.newPhoto({"id":4692432,"src":"Bassetts_Castle_2_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_4692432.html","width":130,"caption":"","height":87});
															thumbnails[4692435] = clik.newPhoto({"id":4692435,"src":"Bassetts_Castle_6_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_4692435.html","width":130,"caption":"","height":87});
															thumbnails[2204607] = clik.newPhoto({"id":2204607,"src":"BC (8)_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_2204607.html","width":130,"caption":"","height":87});
															thumbnails[2204596] = clik.newPhoto({"id":2204596,"src":"BC (3)_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_2204596.html","width":130,"caption":"","height":87});
															thumbnails[4692433] = clik.newPhoto({"id":4692433,"src":"Bassetts_Castle_9_thumb.JPG","galleries_id":142790,"server_id":32,"link":"photo_4692433.html","width":130,"caption":"","height":87});
															thumbnails[7985265] = clik.newPhoto({"id":7985265,"src":"WA_05_thumb.jpg","galleries_id":429339,"server_id":32,"link":"photo_7985265.html","width":130,"caption":"","height":87});
															thumbnails[7985272] = clik.newPhoto({"id":7985272,"src":"WA_011_thumb.jpg","galleries_id":429339,"server_id":32,"link":"photo_7985272.html","width":130,"caption":"","height":87});
															thumbnails[7985273] = clik.newPhoto({"id":7985273,"src":"WA_041_thumb.jpg","galleries_id":429339,"server_id":32,"link":"photo_7985273.html","width":130,"caption":"","height":87});
															thumbnails[7985274] = clik.newPhoto({"id":7985274,"src":"WA_021_thumb.jpg","galleries_id":429339,"server_id":32,"link":"photo_7985274.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[142790] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bassetts Castle (O Gauge)","link":"section560545.html","maxRecords":0.0,"photoIDs":[2204601.0,2204595.0,2204602.0,2204598.0,2204604.0,2204593.0,2204609.0,4692432.0,4692435.0,2204607.0,2204596.0,4692433.0],"skipIndex":0,"section_code":"section560545","featured_images":"4692435,4692433,4692432,2204609,2204607,2204604,2204602,2204601,2204598,2204596","id":142790,"singleSection":true});				  						galleries[463129] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cookton Railroad (On30)","link":"section368970_463129.html","maxRecords":0.0,"photoIDs":[8545553.0,8545554.0,8576552.0,8576553.0],"skipIndex":0,"section_code":"section368970","featured_images":"8576553,8576552,8545554,8545553","id":463129,"singleSection":false});				  						galleries[183811] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Teesside Steel (O Gauge)","link":"section352470_183811.html","maxRecords":0.0,"photoIDs":[2984766.0,2984778.0,3578459.0,3578456.0,3578471.0,4500649.0,4500652.0,4500643.0,4500781.0,5793709.0,5793751.0,4500786.0,4500789.0,5793719.0,5793723.0,5793717.0,5793712.0,5793720.0,5793730.0,5793732.0,6399211.0,6399207.0,6399209.0,6399208.0],"skipIndex":0,"section_code":"section352470","featured_images":"6399211,6399209,6399208,6399207,5793751,5793732,5793730,5793723,5793720,5793719","id":183811,"singleSection":false});				  						galleries[349772] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Oakglen Railroad (On30 Gauge)","link":"section352470_349772.html","maxRecords":0.0,"photoIDs":[6411257.0,6411258.0,6411262.0,6411264.0,6411265.0,6411266.0,6411267.0,6411269.0,6411270.0],"skipIndex":0,"section_code":"section352470","featured_images":"6411270,6411269,6411267,6411266,6411265,6411264,6411262,6411258,6411257","id":349772,"singleSection":false});				  						galleries[145650] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Claughton Works (O-16.5 Gauge)","link":"section352470_145650.html","maxRecords":0.0,"photoIDs":[2236446.0,2236447.0,2236461.0,2236454.0,2236453.0,2236449.0,2236452.0,2236450.0,2236451.0],"skipIndex":0,"section_code":"section352470","featured_images":"2236461,2236454,2236453,2236452,2236451,2236450,2236449,2236447,2236446","id":145650,"singleSection":false});				  						galleries[463128] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Thorne Hill Colliery (O Gauge)","link":"section368970_463128.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section368970","featured_images":"","id":463128,"singleSection":false});				  						galleries[142792] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Caxton Gibbet (OO Gauge)","link":"section352470_142792.html","maxRecords":0.0,"photoIDs":[2984783.0,2984784.0,2984785.0,2984790.0,2984792.0,2984788.0,2984789.0,2984787.0,2984786.0],"skipIndex":0,"section_code":"section352470","featured_images":"2984792,2984790,2984789,2984788,2984787,2984786,2984785,2984784,2984783","id":142792,"singleSection":false});				  						galleries[142791] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Auton Yard (HO Gauge)","link":"section352470_142791.html","maxRecords":0.0,"photoIDs":[2204583.0,2204590.0,2204585.0,2204580.0,2204582.0,2204589.0,2204578.0,2204591.0,2204592.0],"skipIndex":0,"section_code":"section352470","featured_images":"2204592,2204591,2204590,2204589,2204585,2204583,2204582,2204580,2204578","id":142791,"singleSection":false});				  						galleries[429339] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Western Avenue (O Gauge)","link":"section560546.html","maxRecords":0.0,"photoIDs":[7985265.0,7985272.0,7985273.0,7985274.0],"skipIndex":0,"section_code":"section560546","featured_images":"7985274,7985273,7985272,7985265","id":429339,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '2155194';
imageSets[3] = '8576553,8576552,8545554,8545553,7985274,7985273,7985272,7985265,6411270,6411269,6411267,6411266,6411265,6411264,6411262,6411258,6411257,6399211,6399209,6399208,6399207,5793751,5793732,5793730,5793723,5793720,5793719,5793717,5793712,5793709,4692435,4692433,4692432,4500789,4500786,4500781,4500652,4500649,4500643,3578471,3578459,3578456,2984792,2984790,2984789,2984788,2984787,2984786,2984785,2984784';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/RAFKinloss/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/RAFKinloss/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 += 'section352470.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 && 'section352470' != '') {
					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 = 'Royal Air Force Kinloss Model Railway Club: ' + 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;
	}
}

			

