window.thumbnails = {};
															thumbnails[839841] = clik.newPhoto({"id":839841,"src":"member_logo2_thumb.gif","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":54});
															thumbnails[6246269] = clik.newPhoto({"id":6246269,"src":"ct_photo_new_thumb.jpg","galleries_id":"","server_id":35,"link":"#","width":130,"caption":"","height":22});
															thumbnails[6245750] = clik.newPhoto({"id":6245750,"src":"37_thumb.jpg","galleries_id":347557,"server_id":1,"link":"photo_6245750.html","width":130,"caption":"","height":90});
															thumbnails[6246049] = clik.newPhoto({"id":6246049,"src":"57_thumb.jpg","galleries_id":347557,"server_id":1,"link":"photo_6246049.html","width":130,"caption":"","height":195});
															thumbnails[6246051] = clik.newPhoto({"id":6246051,"src":"DSC_2472_thumb.jpg","galleries_id":347557,"server_id":1,"link":"photo_6246051.html","width":130,"caption":"","height":80});
															thumbnails[6246052] = clik.newPhoto({"id":6246052,"src":"DSC_2533_thumb.jpg","galleries_id":347557,"server_id":1,"link":"photo_6246052.html","width":130,"caption":"","height":82});
															thumbnails[6246053] = clik.newPhoto({"id":6246053,"src":"DSC_2577_Retouch_thumb.jpg","galleries_id":347557,"server_id":1,"link":"photo_6246053.html","width":130,"caption":"","height":175});
															thumbnails[6246054] = clik.newPhoto({"id":6246054,"src":"DSC_2786_Retouch_thumb.jpg","galleries_id":347557,"server_id":1,"link":"photo_6246054.html","width":130,"caption":"","height":178});
															thumbnails[6582068] = clik.newPhoto({"id":6582068,"src":"700_2251_thumb.jpg","galleries_id":347561,"server_id":1,"link":"photo_6582068.html","width":130,"caption":"","height":86});
															thumbnails[6582073] = clik.newPhoto({"id":6582073,"src":"700_2354_thumb.jpg","galleries_id":347557,"server_id":1,"link":"photo_6582073.html","width":130,"caption":"","height":204});
															thumbnails[6582075] = clik.newPhoto({"id":6582075,"src":"700_2582_thumb.jpg","galleries_id":347557,"server_id":1,"link":"photo_6582075.html","width":130,"caption":"","height":86});
															thumbnails[6651285] = clik.newPhoto({"id":6651285,"src":"700_2234_thumb.jpg","galleries_id":347561,"server_id":1,"link":"photo_6651285.html","width":130,"caption":"","height":98});
															thumbnails[6651293] = clik.newPhoto({"id":6651293,"src":"Leo_03062006_0137_thumb.jpg","galleries_id":347561,"server_id":1,"link":"photo_6651293.html","width":130,"caption":"","height":87});
															thumbnails[6651301] = clik.newPhoto({"id":6651301,"src":"NIK_0038_thumb.jpg","galleries_id":347561,"server_id":1,"link":"photo_6651301.html","width":130,"caption":"","height":90});
															thumbnails[6651312] = clik.newPhoto({"id":6651312,"src":"Poppy_04_thumb.jpg","galleries_id":347561,"server_id":1,"link":"photo_6651312.html","width":130,"caption":"","height":98});
															thumbnails[9063190] = clik.newPhoto({"id":9063190,"src":"Scap_Heap_crop_thumb.jpg","galleries_id":477889,"server_id":1,"link":"photo_9063190.html","width":130,"caption":"","height":96});
															thumbnails[9063191] = clik.newPhoto({"id":9063191,"src":"Fat_Boy_01_thumb.jpg","galleries_id":477889,"server_id":1,"link":"photo_9063191.html","width":130,"caption":"","height":73});
															thumbnails[9063275] = clik.newPhoto({"id":9063275,"src":"Stone_Wall_thumb.jpg","galleries_id":477889,"server_id":1,"link":"photo_9063275.html","width":130,"caption":"","height":87});
															thumbnails[9063293] = clik.newPhoto({"id":9063293,"src":"CTP_0043_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_9063293.html","width":130,"caption":"","height":87});
															thumbnails[9063295] = clik.newPhoto({"id":9063295,"src":"IMG_0266_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_9063295.html","width":130,"caption":"","height":87});
															thumbnails[6247849] = clik.newPhoto({"id":6247849,"src":"01_thumb.JPG","galleries_id":347558,"server_id":1,"link":"photo_6247849.html","width":130,"caption":"","height":98});
															thumbnails[6247852] = clik.newPhoto({"id":6247852,"src":"02_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6247852.html","width":130,"caption":"","height":98});
															thumbnails[6247859] = clik.newPhoto({"id":6247859,"src":"03_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6247859.html","width":130,"caption":"","height":98});
															thumbnails[6247860] = clik.newPhoto({"id":6247860,"src":"04_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6247860.html","width":130,"caption":"","height":98});
															thumbnails[6247867] = clik.newPhoto({"id":6247867,"src":"05_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6247867.html","width":130,"caption":"","height":98});
															thumbnails[6248134] = clik.newPhoto({"id":6248134,"src":"06_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248134.html","width":130,"caption":"","height":98});
															thumbnails[6248177] = clik.newPhoto({"id":6248177,"src":"07_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248177.html","width":130,"caption":"","height":98});
															thumbnails[6248178] = clik.newPhoto({"id":6248178,"src":"08_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248178.html","width":130,"caption":"","height":98});
															thumbnails[6248181] = clik.newPhoto({"id":6248181,"src":"09_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248181.html","width":130,"caption":"","height":98});
															thumbnails[6248195] = clik.newPhoto({"id":6248195,"src":"10_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248195.html","width":130,"caption":"","height":98});
															thumbnails[8963060] = clik.newPhoto({"id":8963060,"src":"BSB_Thruxton_30-05-11014_44961B25-1EC9-D45B-1C560C190CBF0A22_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963060.html","width":130,"caption":"BSB Thruxton 30-05-11014","height":83});
															thumbnails[8963278] = clik.newPhoto({"id":8963278,"src":"700_1747_455819B5-1EC9-D45B-1C3AAC7F9B7FDE80_thumb.jpg","galleries_id":471759,"server_id":1,"link":"photo_8963278.html","width":130,"caption":"700 1747","height":86});
															thumbnails[8963287] = clik.newPhoto({"id":8963287,"src":"Rally_Supercar_Day_2004_17_455EF2DE-1EC9-D45B-1C20D7374EEB4390_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963287.html","width":130,"caption":"Rally Supercar Day 2004 (17)","height":93});
															thumbnails[6248197] = clik.newPhoto({"id":6248197,"src":"11_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248197.html","width":130,"caption":"","height":98});
															thumbnails[6248202] = clik.newPhoto({"id":6248202,"src":"12_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248202.html","width":130,"caption":"","height":98});
															thumbnails[6248231] = clik.newPhoto({"id":6248231,"src":"13_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248231.html","width":130,"caption":"","height":98});
															thumbnails[6248233] = clik.newPhoto({"id":6248233,"src":"14_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248233.html","width":130,"caption":"","height":98});
															thumbnails[6248234] = clik.newPhoto({"id":6248234,"src":"15_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248234.html","width":130,"caption":"","height":98});
															thumbnails[6248235] = clik.newPhoto({"id":6248235,"src":"16_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248235.html","width":130,"caption":"","height":98});
															thumbnails[6248249] = clik.newPhoto({"id":6248249,"src":"17_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248249.html","width":130,"caption":"","height":98});
															thumbnails[6248250] = clik.newPhoto({"id":6248250,"src":"18_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248250.html","width":130,"caption":"","height":98});
															thumbnails[6248251] = clik.newPhoto({"id":6248251,"src":"19_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248251.html","width":130,"caption":"","height":98});
															thumbnails[6248253] = clik.newPhoto({"id":6248253,"src":"20_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248253.html","width":130,"caption":"","height":98});
															thumbnails[8963061] = clik.newPhoto({"id":8963061,"src":"BSB_Thruxton_30-05-11022_44967019-1EC9-D45B-1C428F8E754B9D8A_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963061.html","width":130,"caption":"BSB Thruxton 30-05-11022","height":79});
															thumbnails[8963279] = clik.newPhoto({"id":8963279,"src":"700_1805_Retouch_4558785F-1EC9-D45B-1CED0445D8413253_thumb.jpg","galleries_id":471759,"server_id":1,"link":"photo_8963279.html","width":130,"caption":"700 1805 Retouch","height":86});
															thumbnails[8963288] = clik.newPhoto({"id":8963288,"src":"WRC_Wales_Rally_2004_1_455F3877-1EC9-D45B-1C5C19ABE2D0AE26_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963288.html","width":130,"caption":"WRC Wales Rally 2004 (1)","height":87});
															thumbnails[6248259] = clik.newPhoto({"id":6248259,"src":"21_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248259.html","width":130,"caption":"","height":98});
															thumbnails[6248261] = clik.newPhoto({"id":6248261,"src":"22_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248261.html","width":130,"caption":"","height":98});
															thumbnails[6248263] = clik.newPhoto({"id":6248263,"src":"23_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248263.html","width":130,"caption":"","height":98});
															thumbnails[6248265] = clik.newPhoto({"id":6248265,"src":"24_thumb.jpg","galleries_id":347558,"server_id":1,"link":"photo_6248265.html","width":130,"caption":"","height":98});
															thumbnails[8963062] = clik.newPhoto({"id":8963062,"src":"BSB_Thruxton_30-05-11029_4496FBE7-1EC9-D45B-1C0708AB76A94DD1_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963062.html","width":130,"caption":"BSB Thruxton 30-05-11029","height":81});
															thumbnails[8963280] = clik.newPhoto({"id":8963280,"src":"700_1823_Retouch_BW_4558C49D-1EC9-D45B-1C337306E370CF34_thumb.jpg","galleries_id":471759,"server_id":1,"link":"photo_8963280.html","width":130,"caption":"700 1823 Retouch BW","height":91});
															thumbnails[8963289] = clik.newPhoto({"id":8963289,"src":"WRC_Wales_Rally_2004_20_455F757D-1EC9-D45B-1CF2705A722D9475_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963289.html","width":130,"caption":"WRC Wales Rally 2004 (20)","height":87});
															thumbnails[8963063] = clik.newPhoto({"id":8963063,"src":"CTP_0001_44974E78-1EC9-D45B-1C3290A03B4F2D8F_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963063.html","width":130,"caption":"CTP 0001","height":87});
															thumbnails[8963281] = clik.newPhoto({"id":8963281,"src":"DSC_0748_4559066D-1EC9-D45B-1C36B89B57361092_thumb.jpg","galleries_id":471759,"server_id":1,"link":"photo_8963281.html","width":130,"caption":"DSC 0748","height":86});
															thumbnails[8963064] = clik.newPhoto({"id":8963064,"src":"CTP_0014_4497A4C6-1EC9-D45B-1CB0F96FC7364C9C_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963064.html","width":130,"caption":"CTP 0014","height":87});
															thumbnails[8963282] = clik.newPhoto({"id":8963282,"src":"DSCF1659_4559507D-1EC9-D45B-1C45F1AAD0E6334F_thumb.jpg","galleries_id":471759,"server_id":1,"link":"photo_8963282.html","width":130,"caption":"DSCF1659","height":87});
															thumbnails[8963065] = clik.newPhoto({"id":8963065,"src":"CTP_0060_4497FD10-1EC9-D45B-1C1EAD73B2AA59B5_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963065.html","width":130,"caption":"CTP 0060","height":87});
															thumbnails[8963283] = clik.newPhoto({"id":8963283,"src":"DSCF1696_1B_455990F3-1EC9-D45B-1C713508C961ACB6_thumb.jpg","galleries_id":471759,"server_id":1,"link":"photo_8963283.html","width":130,"caption":"DSCF1696 1B","height":82});
															thumbnails[8963066] = clik.newPhoto({"id":8963066,"src":"CTP_0062_44985329-1EC9-D45B-1C213CD5DD9DE10A_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963066.html","width":130,"caption":"CTP 0062","height":87});
															thumbnails[8963284] = clik.newPhoto({"id":8963284,"src":"Jaguar_4559EAA9-1EC9-D45B-1C3DD5659B10C1CF_thumb.jpg","galleries_id":471759,"server_id":1,"link":"photo_8963284.html","width":130,"caption":"Jaguar","height":86});
															thumbnails[8963067] = clik.newPhoto({"id":8963067,"src":"CTP_0066_4498A108-1EC9-D45B-1CA12822613BC3F7_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963067.html","width":130,"caption":"CTP 0066","height":87});
															thumbnails[8963068] = clik.newPhoto({"id":8963068,"src":"CTP_0069_4498E6E8-1EC9-D45B-1C241126DC6F37C0_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963068.html","width":130,"caption":"CTP 0069","height":52});
															thumbnails[8963069] = clik.newPhoto({"id":8963069,"src":"CTP_0075_449938AC-1EC9-D45B-1C0CE602689116DF_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963069.html","width":130,"caption":"CTP 0075","height":87});
															thumbnails[8963071] = clik.newPhoto({"id":8963071,"src":"CTP_0090_44998A1E-1EC9-D45B-1C8B9D38A8632E07_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963071.html","width":130,"caption":"CTP 0090","height":87});
															thumbnails[8963072] = clik.newPhoto({"id":8963072,"src":"CTP_0109_4499D115-1EC9-D45B-1C30A61EBA9331E2_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963072.html","width":130,"caption":"CTP 0109","height":87});
															thumbnails[8963073] = clik.newPhoto({"id":8963073,"src":"CTP_1033_449A1670-1EC9-D45B-1C02A8A3EB31B31A_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963073.html","width":130,"caption":"CTP 1033","height":87});
															thumbnails[8963074] = clik.newPhoto({"id":8963074,"src":"CTP_1196_449A68CE-1EC9-D45B-1CE30525E9111485_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963074.html","width":130,"caption":"CTP 1196","height":87});
															thumbnails[8963076] = clik.newPhoto({"id":8963076,"src":"IMG_0084_449AAA0B-1EC9-D45B-1C2DFA281B61E3D9_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963076.html","width":130,"caption":"IMG 0084","height":87});
															thumbnails[8963077] = clik.newPhoto({"id":8963077,"src":"IMG_0114_449AF7A6-1EC9-D45B-1CC1AA316BDD363F_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963077.html","width":130,"caption":"IMG 0114","height":87});
															thumbnails[8963078] = clik.newPhoto({"id":8963078,"src":"IMG_0266_449B3734-1EC9-D45B-1C48E695741CD6B8_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963078.html","width":130,"caption":"IMG 0266","height":87});
															thumbnails[8963079] = clik.newPhoto({"id":8963079,"src":"IMG_0424_449B8794-1EC9-D45B-1C6B1BF34E45E116_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963079.html","width":130,"caption":"IMG 0424","height":87});
															thumbnails[8963081] = clik.newPhoto({"id":8963081,"src":"IMG_0440_449BD374-1EC9-D45B-1C1211B71B973E3E_thumb.jpg","galleries_id":471751,"server_id":1,"link":"photo_8963081.html","width":130,"caption":"IMG 0440","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[471751] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Motor Sports","link":"section414853_471751.html","maxRecords":0.0,"photoIDs":[9063293.0,9063295.0,8963060.0,8963287.0,8963061.0,8963288.0,8963062.0,8963289.0,8963063.0,8963064.0,8963065.0,8963066.0,8963067.0,8963068.0,8963069.0,8963071.0,8963072.0,8963073.0,8963074.0,8963076.0,8963077.0,8963078.0,8963079.0,8963081.0],"skipIndex":0,"section_code":"section414853","featured_images":8963060.0,"id":471751,"singleSection":false});				  						galleries[347557] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"section414853_347557.html","maxRecords":0.0,"photoIDs":[6245750.0,6246049.0,6246051.0,6246052.0,6246053.0,6246054.0,6582073.0,6582075.0],"skipIndex":0,"section_code":"section414853","featured_images":6246052.0,"id":347557,"singleSection":false});				  						galleries[347558] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"section414853_347558.html","maxRecords":0.0,"photoIDs":[6247849.0,6247852.0,6247859.0,6247860.0,6247867.0,6248134.0,6248177.0,6248178.0,6248181.0,6248195.0,6248197.0,6248202.0,6248231.0,6248233.0,6248234.0,6248235.0,6248249.0,6248250.0,6248251.0,6248253.0,6248259.0,6248261.0,6248263.0,6248265.0],"skipIndex":0,"section_code":"section414853","featured_images":6247852.0,"id":347558,"singleSection":false});				  						galleries[471759] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife","link":"section414853_471759.html","maxRecords":0.0,"photoIDs":[8963278.0,8963279.0,8963280.0,8963281.0,8963282.0,8963283.0,8963284.0],"skipIndex":0,"section_code":"section414853","featured_images":8963278.0,"id":471759,"singleSection":false});				  						galleries[347561] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Pets","link":"section414853_347561.html","maxRecords":0.0,"photoIDs":[6582068.0,6651285.0,6651293.0,6651301.0,6651312.0],"skipIndex":0,"section_code":"section414853","featured_images":6582068.0,"id":347561,"singleSection":false});				  						galleries[477889] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Commercial","link":"section414853_477889.html","maxRecords":0.0,"photoIDs":[9063190.0,9063191.0,9063275.0],"skipIndex":0,"section_code":"section414853","featured_images":"9063275,9063191,9063190","id":477889,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8963069';
imageSets[2] = '6582068,6246052,6247852,8963278,8963060';
imageSets[3] = '9063295,9063293,9063275,9063191,9063190,8963289,8963288,8963287,8963284,8963283,8963282,8963281,8963280,8963279,8963278,8963081,8963079,8963078,8963077,8963076,8963074,8963073,8963072,8963071,8963069,8963068,8963067,8963066,8963065,8963064,8963063,8963062,8963061,8963060,6651312,6651301,6651293,6651285,6582075,6582073,6582068,6248265,6248263,6248261,6248259,6248253,6248251,6248250,6248249,6248235';
imageSets[247020] = '6247860';
imageSets[247019] = '6246053';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/carllewis/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/carllewis/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/carllewis/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/carllewis/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/carllewis/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/carllewis/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/carllewis/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/carllewis/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 += 'section414853.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 && 'section414853' != '') {
					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 = 'CT Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.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>Carl Tregidgo </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="carl@tregidgo.demon.co.uk">';
					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="carl@tregidgo.demon.co.uk">';
				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;
	}
}

			

