window.thumbnails = new Object();
												thumbnails[2004996] = new thumbnail(2004996,'','','tartan dragon 3 copy_thumb.jpg',130, 94,1,'#');
												thumbnails[2085342] = new thumbnail(2085342,'204875','Work commissioned by Llettygynfach Farm, Forden. Welshpool, home of quality beef and lamb.','Llettygynfach low _thumb.jpg',130, 87,1,'photo_2085342.html');
												thumbnails[1695212] = new thumbnail(1695212,'112232','','balloon 0low  stormcolour_thumb.jpg',130, 87,1,'photo_1695212.html');
												thumbnails[2382517] = new thumbnail(2382517,'111840','','dave and karen low 048_thumb.jpg',130, 86,1,'photo_2382517.html');
												thumbnails[3807624] = new thumbnail(3807624,'111840','','21st_birthday92dpia__thumb.jpg',130, 195,1,'photo_3807624.html');
												thumbnails[4588132] = new thumbnail(4588132,'111840','','aswedding_245low_thumb.jpg',130, 87,1,'photo_4588132.html');
												thumbnails[5870751] = new thumbnail(5870751,'112232','','Aberystwyth_lowres1_thumb.jpg',130, 87,1,'photo_5870751.html');
												thumbnails[1655195] = new thumbnail(1655195,'112232','','bwcolour huntjpg low res1_thumb.jpg',130, 91,1,'photo_1655195.html');
												thumbnails[1662374] = new thumbnail(1662374,'111840','','proof12low_thumb.jpg',130, 87,1,'photo_1662374.html');
												thumbnails[1662741] = new thumbnail(1662741,'112232','Portrait of Berriew','Berriewlow_thumb.jpg',130, 195,1,'photo_1662741.html');
												thumbnails[1697700] = new thumbnail(1697700,'114197','Spoiling a good photo they are!!','becky holiday 030 copy_thumb.jpg',130, 98,1,'photo_1697700.html');
												thumbnails[1712614] = new thumbnail(1712614,'115087','Created using your photo or ones I have taken for you','karenlow_thumb.jpg',130, 87,1,'photo_1712614.html');
												thumbnails[1712621] = new thumbnail(1712621,'115088','A Custom Plaque (using your photo) to keep away strangers!','bitelow copy_thumb.jpg',130, 195,1,'photo_1712621.html');
												thumbnails[1662387] = new thumbnail(1662387,'111840','','Lukeage1low_thumb.jpg',130, 184,1,'photo_1662387.html');
												thumbnails[2943699] = new thumbnail(2943699,'112232','On Time, steam train at Llangollen','llangollen 088bc_thumb.jpg',130, 195,1,'photo_2943699.html');
												thumbnails[6539917] = new thumbnail(6539917,'204875','Rally car in Wales','rally_car11low_thumb.jpg',130, 195,1,'photo_6539917.html');
												thumbnails[2885620] = new thumbnail(2885620,'179109','Please click on the voucher for more details','voucherlow_thumb.jpg',130, 68,1,'photo_2885620.html');
												thumbnails[4397737] = new thumbnail(4397737,'111840','','aswedding_low077_thumb.jpg',130, 195,1,'photo_4397737.html');
												thumbnails[6539925] = new thumbnail(6539925,'204875','Rally car Wales','vernwy_062low_thumb.jpg',130, 195,1,'photo_6539925.html');
												thumbnails[3356248] = new thumbnail(3356248,'204875','','copied disc 1low 206_thumb.jpg',130, 86,1,'photo_3356248.html');
												thumbnails[3356258] = new thumbnail(3356258,'204875','','copied disc 1low 201_thumb.jpg',130, 86,1,'photo_3356258.html');
												thumbnails[6722604] = new thumbnail(6722604,'204875','','vaynor_rallyalow12_thumb.jpg',130, 87,1,'photo_6722604.html');
												thumbnails[2382539] = new thumbnail(2382539,'111840','','dave and karen low 056_thumb.jpg',130, 86,1,'photo_2382539.html');
												thumbnails[3807632] = new thumbnail(3807632,'111840','','21st_birthday92dpia_thumb.jpg',130, 195,1,'photo_3807632.html');
												thumbnails[6722737] = new thumbnail(6722737,'115087','Welshpool & District Flower Arranging Society Golden Anniversary','festivalblacklow1_thumb.jpg',130, 87,1,'photo_6722737.html');
												thumbnails[3967412] = new thumbnail(3967412,'115087','','lowlucasmontc_jpg12_thumb.jpg',130, 98,1,'photo_3967412.html');
												thumbnails[4397739] = new thumbnail(4397739,'111840','','alwynsam_low098_copy_thumb.jpg',130, 87,1,'photo_4397739.html');
												thumbnails[6722756] = new thumbnail(6722756,'115087','','festival_1low_thumb.jpg',130, 87,1,'photo_6722756.html');
												thumbnails[1655201] = new thumbnail(1655201,'112232','Hot Air Balloon over Church St, Welshpool','corn store st mary\'s low res_thumb.jpg',130, 86,1,'photo_1655201.html');
												thumbnails[1662744] = new thumbnail(1662744,'112232','Llangollen, not to be missed while in Wales','llangollanlow_thumb.jpg',130, 195,1,'photo_1662744.html');
												thumbnails[1712615] = new thumbnail(1712615,'115087','Maybe with an interesting tint!','karensepialow_thumb.jpg',130, 87,1,'photo_1712615.html');
												thumbnails[1712625] = new thumbnail(1712625,'115088','To announce a new arrival!','new folder 001bb_thumb.jpg',130, 87,1,'photo_1712625.html');
												thumbnails[2780107] = new thumbnail(2780107,'115087','','wedding4low_thumb.jpg',130, 87,1,'photo_2780107.html');
												thumbnails[2523281] = new thumbnail(2523281,'115087',' 50th birthday, anniversary retirement gift','fraser montagelow_thumb.jpg',130, 87,1,'photo_2523281.html');
												thumbnails[3356294] = new thumbnail(3356294,'204875','','low025_thumb.jpg',130, 86,1,'photo_3356294.html');
												thumbnails[3356302] = new thumbnail(3356302,'204875','','low063_thumb.jpg',130, 86,1,'photo_3356302.html');
												thumbnails[4588686] = new thumbnail(4588686,'111840','','aswedding_low354xx_thumb.jpg',130, 195,1,'photo_4588686.html');
												thumbnails[1662430] = new thumbnail(1662430,'111840','','pasttimes007_thumb.jpg',130, 182,1,'photo_1662430.html');
												thumbnails[6654973] = new thumbnail(6654973,'115087','','beckymontlow1_thumb.jpg',130, 87,1,'photo_6654973.html');
												thumbnails[2808621] = new thumbnail(2808621,'111840','','wedding low 030ab_thumb.jpg',130, 195,1,'photo_2808621.html');
												thumbnails[2451899] = new thumbnail(2451899,'111840','','Railway Children lowfinal_thumb.jpg',130, 195,1,'photo_2451899.html');
												thumbnails[2808636] = new thumbnail(2808636,'111840','','wedding low018bc_thumb.jpg',130, 195,1,'photo_2808636.html');
												thumbnails[3807638] = new thumbnail(3807638,'111840','','21st_birthday92dpib_thumb.jpg',130, 195,1,'photo_3807638.html');
												thumbnails[6978656] = new thumbnail(6978656,'115087','Using YOUR photos','helens_wedding_3low1_thumb.jpg',130, 98,1,'photo_6978656.html');
												thumbnails[1662330] = new thumbnail(1662330,'204875','A family run pub,The Railway Inn Forden.','railwayinnlow_thumb.jpg',130, 87,1,'photo_1662330.html');
												thumbnails[1662382] = new thumbnail(1662382,'111840','','baby 007_thumb.jpg',130, 96,1,'photo_1662382.html');
												thumbnails[1662814] = new thumbnail(1662814,'112232','Portrait of Montgomery','montgomerylow1_thumb.jpg',130, 195,1,'photo_1662814.html');
												thumbnails[1712616] = new thumbnail(1712616,'115087','It can be any subject you like','mick and pam1low_thumb.jpg',130, 189,1,'photo_1712616.html');
												thumbnails[1712631] = new thumbnail(1712631,'115088','Maybe something humourous!','luke\'s room_thumb.jpg',130, 195,1,'photo_1712631.html');
												thumbnails[1662391] = new thumbnail(1662391,'111840','A Combination of at least 8 photographs blended together! The ULTIMATE portrait which brings together all the things in your life which give the portrait a time and place!','at40_thumb.jpg',130, 195,1,'photo_1662391.html');
												thumbnails[1714180] = new thumbnail(1714180,'112232','HRH The Prince of Wales at Leighton 8th June 2007','HRHPrinceofWaleslow_thumb.jpg',130, 195,1,'photo_1714180.html');
												thumbnails[1697696] = new thumbnail(1697696,'111840','','Stuart white border f c copy_thumb.jpg',130, 190,1,'photo_1697696.html');
												thumbnails[1818191] = new thumbnail(1818191,'111840','','Butterfly Paradise master elowres_thumb.jpg',130, 130,1,'photo_1818191.html');
												thumbnails[4588090] = new thumbnail(4588090,'111840','','aswedding_071low_thumb.jpg',130, 87,1,'photo_4588090.html');
												thumbnails[6632949] = new thumbnail(6632949,'111840','','may22_344low_thumb.jpg',130, 87,1,'photo_6632949.html');
												thumbnails[1697701] = new thumbnail(1697701,'114197','That\'s much better!','becky holiday 030b copy_thumb.jpg',130, 98,1,'photo_1697701.html');
												thumbnails[2995410] = new thumbnail(2995410,'204875','Poster advertising event.','magiscroft low_thumb.jpg',130, 86,1,'photo_2995410.html');
												thumbnails[1697705] = new thumbnail(1697705,'114197','He was a pain, glad he\'s gone!','becky holiday 030ri copy_thumb.jpg',130, 93,1,'photo_1697705.html');
												thumbnails[1697727] = new thumbnail(1697727,'111840','','new folder 001b copy_thumb.jpg',130, 87,1,'photo_1697727.html');
												thumbnails[1662379] = new thumbnail(1662379,'111840','','baby003low_thumb.jpg',130, 96,1,'photo_1662379.html');
												thumbnails[1668255] = new thumbnail(1668255,'111840','Portrait of the Railway Inn Forden Welshpool','railwayinnlow1_thumb.jpg',130, 87,1,'photo_1668255.html');
												thumbnails[4397731] = new thumbnail(4397731,'111840','','asweddinglow_2741_thumb.jpg',130, 87,1,'photo_4397731.html');
												thumbnails[2382656] = new thumbnail(2382656,'115087','The Castle Inn, Edgehill Oxfordshire','low Battle of Edgehill storm Ltd Ed_thumb.jpg',130, 195,1,'photo_2382656.html');
												thumbnails[1655189] = new thumbnail(1655189,'112232','','A storm at the old station low res_thumb.jpg',130, 86,1,'photo_1655189.html');
												thumbnails[1697715] = new thumbnail(1697715,'114197','BEFORE (badly faded)','herman copy_thumb.jpg',130, 91,1,'photo_1697715.html');
												thumbnails[1662393] = new thumbnail(1662393,'111840','','Martin Smith 061_thumb.jpg',130, 195,1,'photo_1662393.html');
												thumbnails[1697716] = new thumbnail(1697716,'114197','AFTER (contrast and tone corrected)','herman jpg 1 copy_thumb.jpg',130, 91,1,'photo_1697716.html');
												thumbnails[1662433] = new thumbnail(1662433,'111840','','pasttimes012low_thumb.jpg',130, 182,1,'photo_1662433.html');
												thumbnails[1697717] = new thumbnail(1697717,'114197','BEFORE (creased and rough around the edges)','herman003 copy_thumb.jpg',130, 184,1,'photo_1697717.html');
												thumbnails[3356257] = new thumbnail(3356257,'204875','','copied disc 1 low200_thumb.jpg',130, 196,1,'photo_3356257.html');
												thumbnails[1697718] = new thumbnail(1697718,'114197','AFTER (creases and folds gone and tidied up ready for another 70 years!)','herman003a copy_thumb.jpg',130, 195,1,'photo_1697718.html');
												thumbnails[5291015] = new thumbnail(5291015,'111840','','copied_disc_2_pepi081_copy_thumb.jpg',130, 162,1,'photo_5291015.html');
												thumbnails[2382545] = new thumbnail(2382545,'115087','Have a quality montage made of your pet, be it a dog, cat, pony or even your prize bull!','Teddy low 1_thumb.jpg',130, 87,1,'photo_2382545.html');
												thumbnails[3356260] = new thumbnail(3356260,'204875','','copied disc 1 low181_thumb.jpg',130, 86,1,'photo_3356260.html');
												thumbnails[5291027] = new thumbnail(5291027,'111840','','hunt2009_017512_thumb.jpg',130, 86,1,'photo_5291027.html');
												thumbnails[1662435] = new thumbnail(1662435,'111840','','pasttimes016low_thumb.jpg',130, 195,1,'photo_1662435.html');
												thumbnails[3356293] = new thumbnail(3356293,'204875','','low015_thumb.jpg',130, 86,1,'photo_3356293.html');
												thumbnails[1662499] = new thumbnail(1662499,'111840','','baby001low_thumb.jpg',130, 97,1,'photo_1662499.html');
												thumbnails[3356296] = new thumbnail(3356296,'204875','','low041_thumb.jpg',130, 86,1,'photo_3356296.html');
												thumbnails[1712613] = new thumbnail(1712613,'111840','','karenlow1_thumb.jpg',130, 195,1,'photo_1712613.html');
												thumbnails[3356298] = new thumbnail(3356298,'204875','','low043_thumb.jpg',130, 86,1,'photo_3356298.html');
												thumbnails[2730905] = new thumbnail(2730905,'111840','','fraser010low21_thumb.jpg',130, 91,1,'photo_2730905.html');
												thumbnails[3356300] = new thumbnail(3356300,'204875','','low059_thumb.jpg',130, 91,1,'photo_3356300.html');
												thumbnails[1662439] = new thumbnail(1662439,'111840','','pasttimes019low_thumb.jpg',130, 192,1,'photo_1662439.html');
												thumbnails[1697721] = new thumbnail(1697721,'114197','This photo would look good in colour!','peter copy_thumb.jpg',130, 173,1,'photo_1697721.html');
												thumbnails[1797244] = new thumbnail(1797244,'115087','You can have a commemorative montage made as a tribute to a loved one.','tributelow_thumb.jpg',130, 195,1,'photo_1797244.html');
												thumbnails[1818769] = new thumbnail(1818769,'111840','','Urban Chaos layers 1lowres_thumb.jpg',130, 98,1,'photo_1818769.html');
												thumbnails[3356304] = new thumbnail(3356304,'204875','','low071_thumb.jpg',130, 121,1,'photo_3356304.html');
												thumbnails[1697722] = new thumbnail(1697722,'114197','Hand coloured photo','peter hand coloured copy_thumb.jpg',130, 173,1,'photo_1697722.html');
												thumbnails[1818773] = new thumbnail(1818773,'111840','','Urban Chaos layers 2lowres_thumb.jpg',130, 98,1,'photo_1818773.html');
												thumbnails[3356307] = new thumbnail(3356307,'204875','','low077_thumb.jpg',130, 147,1,'photo_3356307.html');
												thumbnails[1662505] = new thumbnail(1662505,'111840','','Martin Smith 062_thumb.jpg',130, 87,1,'photo_1662505.html');
												thumbnails[3356308] = new thumbnail(3356308,'204875','','low082_thumb.jpg',130, 86,1,'photo_3356308.html');
												thumbnails[1662503] = new thumbnail(1662503,'111840','','pasttimes030low_thumb.jpg',130, 182,1,'photo_1662503.html');
												thumbnails[3356312] = new thumbnail(3356312,'204875','','low111_thumb.jpg',130, 86,1,'photo_3356312.html');
												thumbnails[1662442] = new thumbnail(1662442,'111840','','martin smith x 3_thumb.jpg',130, 87,1,'photo_1662442.html');
												thumbnails[3356314] = new thumbnail(3356314,'204875','','low142_thumb.jpg',130, 86,1,'photo_3356314.html');
												thumbnails[3356316] = new thumbnail(3356316,'204875','','low156_thumb.jpg',130, 86,1,'photo_3356316.html');
												thumbnails[3356317] = new thumbnail(3356317,'204875','','low160_thumb.jpg',130, 188,1,'photo_3356317.html');
												thumbnails[3356319] = new thumbnail(3356319,'204875','','low no banner_thumb.jpg',130, 91,1,'photo_3356319.html');
												thumbnails[1662501] = new thumbnail(1662501,'111840','','Miragelow_thumb.jpg',130, 182,1,'photo_1662501.html');
												thumbnails[1662819] = new thumbnail(1662819,'112232','The Best of Welshpool Powys','welshpoollow_thumb.jpg',130, 195,1,'photo_1662819.html');
												thumbnails[2382775] = new thumbnail(2382775,'204875','The Castle Inn, Edgehill, Oxfordshire','low wip 13 castle inn mask copy_thumb.jpg',130, 195,1,'photo_2382775.html');
												thumbnails[1712605] = new thumbnail(1712605,'112232','Dambuster over Lake Vyrnwy','vernwylow_thumb.jpg',130, 195,1,'photo_1712605.html');
												thumbnails[1662508] = new thumbnail(1662508,'111840','','proof16low_thumb.jpg',130, 87,1,'photo_1662508.html');
												thumbnails[1662821] = new thumbnail(1662821,'112232','Red Arrows Over Clywedog Dam','RedArrowslow_thumb.jpg',130, 195,1,'photo_1662821.html');
												thumbnails[2808551] = new thumbnail(2808551,'204875','','prince charles low003_thumb.jpg',130, 195,1,'photo_2808551.html');
												thumbnails[2808587] = new thumbnail(2808587,'204875','','prince charles low017_thumb.jpg',130, 195,1,'photo_2808587.html');
												thumbnails[2808593] = new thumbnail(2808593,'204875','','prince charles low025_thumb.jpg',130, 195,1,'photo_2808593.html');
												thumbnails[2808598] = new thumbnail(2808598,'204875','','prince charles low 009_thumb.jpg',130, 195,1,'photo_2808598.html');
												thumbnails[2808600] = new thumbnail(2808600,'204875','','prince charles low 011_thumb.jpg',130, 105,1,'photo_2808600.html');
												thumbnails[1717760] = new thumbnail(1717760,'112232','Llandinam','llandinam Ltd Ed low res _thumb.jpg',130, 195,1,'photo_1717760.html');
												thumbnails[1662828] = new thumbnail(1662828,'112232','Portrait of Bridgnorth Shropshire','bridgnorthlow_thumb.jpg',130, 87,1,'photo_1662828.html');
												thumbnails[1662835] = new thumbnail(1662835,'112232','Prelude to a Dogfight','airshow07low_thumb.jpg',130, 87,1,'photo_1662835.html');
												thumbnails[1714201] = new thumbnail(1714201,'114197','A very small piece of the original with biro marks. Tone and contrast in need of correction.','MILITARY GROUP copy_thumb.jpg',130, 183,1,'photo_1714201.html');
												thumbnails[2451817] = new thumbnail(2451817,'112232','Absolute precision, The Red Arrows','red arrowslow_thumb.jpg',130, 87,1,'photo_2451817.html');
												thumbnails[1714183] = new thumbnail(1714183,'112232','This is Leighton 2007','Leighton2007low_thumb.jpg',130, 195,1,'photo_1714183.html');
												thumbnails[1714202] = new thumbnail(1714202,'114197','Marks removed, tone and contrast corrected','MILITARY GROUP2  copy_thumb.jpg',130, 183,1,'photo_1714202.html');
												thumbnails[1714198] = new thumbnail(1714198,'114197','finally hand coloured','MILITARY GROUP 1 copy_thumb.jpg',130, 183,1,'photo_1714198.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[179109] = new gallery(179109,'2885620','Gift Vouchers','gallery',[2885620],0, 0, '', 'gallery_179109.html',0,0);
				  					galleries[112232] = new gallery(112232,'5870751,2943699,2451817,1717760,1714183,1714180,1712605,1695212,1662835,1662828','Limited Edition Photographs','gallery',[1695212,5870751,1655195,1662741,2943699,1655201,1662744,1662814,1714180,1655189,1662819,1712605,1662821,1717760,1662828,1662835,2451817,1714183],0, 0, '', 'gallery_112232.html',0,0);
				  					galleries[111840] = new gallery(111840,'6632949,5291027,5291015,4588686,4588132,4588090,4397739,4397737,4397731,3807638','Traditional and Modern Portraits','gallery',[2382517,3807624,4588132,1662374,1662387,4397737,2382539,3807632,4397739,4588686,1662430,2808621,2451899,2808636,3807638,1662382,1662391,1697696,1818191,4588090,6632949,1697727,1662379,1668255,4397731,1662393,1662433,5291015,5291027,1662435,1662499,1712613,2730905,1662439,1818769,1818773,1662505,1662503,1662442,1662501,1662508],0, 0, '110923', 'gallery_111840.html',0,0);
				  					galleries[110923] = new gallery(110923,'6632949,5291027,5291015,4588686,4588132,4588090,4397739,4397737,4397731,3807638','Portraits','gallery',[],0, 0, '', 'gallery_110923.html',0,0);
				  					galleries[114197] = new gallery(114197,'1714202,1714201,1714198,1697722,1697721,1697718,1697717,1697716,1697715,1697705','Photo manipulation, retouching and repair','gallery',[1697700,1697701,1697705,1697715,1697716,1697717,1697718,1697721,1697722,1714201,1714202,1714198],0, 0, '', 'gallery_114197.html',0,0);
				  					galleries[204875] = new gallery(204875,'6722604,6539925,6539917,3356319,3356317,3356316,3356314,3356312,3356308,3356307','Commercial','gallery',[2085342,6539917,6539925,3356248,3356258,6722604,3356294,3356302,1662330,2995410,3356257,3356260,3356293,3356296,3356298,3356300,3356304,3356307,3356308,3356312,3356314,3356316,3356317,3356319,2382775,2808551,2808587,2808593,2808598,2808600],0, 0, '', 'gallery_204875.html',0,0);
				  					galleries[115087] = new gallery(115087,'6978656,6722756,6722737,6654973,3967412,2780107,2523281,2382656,2382545,1797244','Special Interest & Event Montages','gallery',[1712614,6722737,3967412,6722756,1712615,2780107,2523281,6654973,6978656,1712616,2382656,2382545,1797244],0, 0, '', 'gallery_115087.html',0,0);
				  					galleries[115088] = new gallery(115088,'1712631,1712625,1712621','Custom Wall Plaques','gallery',[1712621,1712625,1712631],0, 0, '', 'gallery_115088.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3967412,3356302,3356294,3356258,3356248,2780107,2730905,2523281,2382545,2382539,2382517,1818769,1695212,1662508,1662505,1662442,1662379,1662330';
imageSets[3] = '6978656,6722756,6722737,6722604,6654973,6632949,6539925,6539917,5870751,5291027,5291015,4588686,4588132,4588090,4397739,4397737,4397731,3967412,3807638,3807632,3807624,3356319,3356317,3356316,3356314,3356312,3356308,3356307,3356304,3356302,3356300,3356298,3356296,3356294,3356293,3356260,3356258,3356257,3356248,2995410,2943699,2885620,2808636,2808621,2808600,2808598,2808593,2808587,2808551,2780107';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/weebolddavy/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/weebolddavy/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 && backgrounds[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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Tartan Dragon Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp = temp + '<p>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
																				temp = temp + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = 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 = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="weebolddavy@aol.com">';
	temp = temp + '<input type="hidden" name="currency_code" value="GBP">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="weebolddavy@aol.com">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							temp = 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({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* 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 + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

		

