window.thumbnails = {};
															thumbnails[8876135] = clik.newPhoto({"id":8876135,"src":"purple_glass_web_thumb.jpg","galleries_id":134179,"server_id":18,"link":"photo_8876135.html","width":130,"caption":"purple glass","height":175});
															thumbnails[8439189] = clik.newPhoto({"id":8439189,"src":"gulf_mirage_M6_Le_Mans_1973_Hailwood_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_8439189.html","width":130,"caption":"gulf mirage M6 Le Mans 1973 Hailwood","height":90});
															thumbnails[8374899] = clik.newPhoto({"id":8374899,"src":"prytanee_fleche_portail_thumb.jpg","galleries_id":134179,"server_id":18,"link":"photo_8374899.html","width":130,"caption":"le Prytanée la Flèche le portail","height":190});
															thumbnails[8196260] = clik.newPhoto({"id":8196260,"src":"audi_r18_web_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_8196260.html","width":130,"caption":"audi r18 watercolour toombs le mans 2011","height":80});
															thumbnails[8183287] = clik.newPhoto({"id":8183287,"src":"la_Sarthe_à_Dureil_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_8183287.html","width":130,"caption":"la sarthe à Dureil","height":93});
															thumbnails[8183311] = clik.newPhoto({"id":8183311,"src":"Asnieres_11net_thumb.jpg","galleries_id":134179,"server_id":18,"link":"photo_8183311.html","width":130,"caption":"asnieres sur vegre ray toombs","height":100});
															thumbnails[8150223] = clik.newPhoto({"id":8150223,"src":"pilier_au_clefs_net_thumb.jpg","galleries_id":134179,"server_id":18,"link":"photo_8150223.html","width":130,"caption":"pilier au clefs le mans watercolour","height":175});
															thumbnails[8150436] = clik.newPhoto({"id":8150436,"src":"pesca2011net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_8150436.html","width":130,"caption":"pescarolo 2011 watercolour","height":88});
															thumbnails[8150506] = clik.newPhoto({"id":8150506,"src":"LM11net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_8150506.html","width":130,"caption":"corvette lm2011 watercolour","height":92});
															thumbnails[8150565] = clik.newPhoto({"id":8150565,"src":"wavesplash_net_thumb.jpg","galleries_id":134179,"server_id":18,"link":"photo_8150565.html","width":130,"caption":"high rollers watercolour","height":189});
															thumbnails[7964441] = clik.newPhoto({"id":7964441,"src":"finish_web_thumb.jpg","galleries_id":134179,"server_id":18,"link":"photo_7964441.html","width":130,"caption":"Rebellion Lola Toyota watercolour","height":96});
															thumbnails[7902580] = clik.newPhoto({"id":7902580,"src":"mazda_787B_24Hours_LM1991_thumb.jpg","galleries_id":134179,"server_id":18,"link":"photo_7902580.html","width":130,"caption":"mazda 787B 24hours LM1991","height":86});
															thumbnails[7404691] = clik.newPhoto({"id":7404691,"src":"Porsche_917LH_LM1971_thumb.jpg","galleries_id":134179,"server_id":18,"link":"photo_7404691.html","width":130,"caption":"Porsche 917lh LM1971","height":77});
															thumbnails[6963746] = clik.newPhoto({"id":6963746,"src":"512BBLM_1981_net_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_6963746.html","width":130,"caption":"512BBLM Le Mans 1981","height":97});
															thumbnails[6383147] = clik.newPhoto({"id":6383147,"src":"classic10_plat2net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_6383147.html","width":130,"caption":"Le Mans classic 2010 d-type jaguar plateau2","height":186});
															thumbnails[6371247] = clik.newPhoto({"id":6371247,"src":"image_3_jag_net_E2037332-1E4F-37DC-71C7E65203E60544_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_6371247.html","width":130,"caption":"jaguar cats le mans 1990 watercolor","height":88});
															thumbnails[5948682] = clik.newPhoto({"id":5948682,"src":"afghane_84_net_thumb.jpg","galleries_id":69239,"server_id":18,"link":"photo_5948682.html","width":130,"caption":"fille afghane '84 ","height":186});
															thumbnails[5941384] = clik.newPhoto({"id":5941384,"src":"marche_blenet_thumb.jpg","galleries_id":69238,"server_id":18,"link":"photo_5941384.html","width":130,"caption":"la fleche marché aquarelle","height":180});
															thumbnails[5125285] = clik.newPhoto({"id":5125285,"src":"last_check_net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_5125285.html","width":130,"caption":"Last check before the ball","height":188});
															thumbnails[5675487] = clik.newPhoto({"id":5675487,"src":"tom2008_net_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_5675487.html","width":130,"caption":"Tom Kristensen Allan McNish Dindo Capello winners in Audi R10TDI Le Mans 2008","height":75});
															thumbnails[5675518] = clik.newPhoto({"id":5675518,"src":"the_white_glove_net_thumb.jpg","galleries_id":69239,"server_id":18,"link":"photo_5675518.html","width":130,"caption":"the white gloves","height":190});
															thumbnails[5675558] = clik.newPhoto({"id":5675558,"src":"Cavaillon_net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_5675558.html","width":130,"caption":"Cavaillon, roman arches Provence","height":92});
															thumbnails[5125234] = clik.newPhoto({"id":5125234,"src":"lmp2009_restaurant_net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_5125234.html","width":130,"caption":"Aston Martin LMP1 Le Mans 2009","height":94});
															thumbnails[4807349] = clik.newPhoto({"id":4807349,"src":"lm60_no3_net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_4807349.html","width":130,"caption":"LM1960 Corvette at Arnage corner","height":84});
															thumbnails[4765828] = clik.newPhoto({"id":4765828,"src":"pilier_vert_net_thumb.jpg","galleries_id":69238,"server_id":18,"link":"photo_4765828.html","width":130,"caption":"le Pilier Vert, Vieux Mans, 2009","height":103});
															thumbnails[4601493] = clik.newPhoto({"id":4601493,"src":"parce_moulin_net_thumb.jpg","galleries_id":69238,"server_id":18,"link":"photo_4601493.html","width":130,"caption":"parcé moulin sarthe","height":201});
															thumbnails[4320299] = clik.newPhoto({"id":4320299,"src":"lmp1_2009_net_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_4320299.html","width":130,"caption":"aston martin lmp1 le mans 2009","height":88});
															thumbnails[4304677] = clik.newPhoto({"id":4304677,"src":"003net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_4304677.html","width":130,"caption":"le mans 2009 aston martin v8 gt2","height":78});
															thumbnails[4203577] = clik.newPhoto({"id":4203577,"src":"GT40_1969_net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_4203577.html","width":130,"caption":"gt40 le mans 1968","height":77});
															thumbnails[4203584] = clik.newPhoto({"id":4203584,"src":"stjean_motte_09_net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_4203584.html","width":130,"caption":"st jean de la motte watercolour aquarelle","height":179});
															thumbnails[3729322] = clik.newPhoto({"id":3729322,"src":"mercedes_89_no63_net_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_3729322.html","width":130,"caption":"sauber mercedes le mans 1989","height":87});
															thumbnails[3499144] = clik.newPhoto({"id":3499144,"src":"combwich small_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_3499144.html","width":130,"caption":"combwich somerset","height":91});
															thumbnails[3153874] = clik.newPhoto({"id":3153874,"src":"luche church_thumb.jpg","galleries_id":69238,"server_id":18,"link":"photo_3153874.html","width":130,"caption":"eglise luche pringe","height":174});
															thumbnails[2945651] = clik.newPhoto({"id":2945651,"src":"merve luche net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_2945651.html","width":130,"caption":"loir luche pringe aquarelle","height":91});
															thumbnails[2692054] = clik.newPhoto({"id":2692054,"src":"bentley 4,5LM1927net_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_2692054.html","width":130,"caption":"Bentley 1927 4,5litre 'Le Mans'","height":94});
															thumbnails[2522147] = clik.newPhoto({"id":2522147,"src":"dbr9 2008 net_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_2522147.html","width":130,"caption":"dbr9 lm2008 007","height":205});
															thumbnails[2509335] = clik.newPhoto({"id":2509335,"src":"Phil Hill LM58 net_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_2509335.html","width":130,"caption":"Phil Hill Ferrari TR250 1958 winner Le Mans","height":87});
															thumbnails[2415852] = clik.newPhoto({"id":2415852,"src":"dreamz_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_2415852.html","width":130,"caption":"dreamz faut pas rêver","height":186});
															thumbnails[907478] = clik.newPhoto({"id":907478,"src":"chambord_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_907478.html","width":130,"caption":"Chateau_de_Chambord","height":102});
															thumbnails[907488] = clik.newPhoto({"id":907488,"src":"devon_sunrise_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_907488.html","width":130,"caption":"Devon Estuary at sunrise","height":86});
															thumbnails[907505] = clik.newPhoto({"id":907505,"src":"lingerie_thumb.jpg","galleries_id":69239,"server_id":18,"link":"photo_907505.html","width":130,"caption":"lingerie blanche","height":236});
															thumbnails[907508] = clik.newPhoto({"id":907508,"src":"michelle_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_907508.html","width":130,"caption":"le visage","height":97});
															thumbnails[907518] = clik.newPhoto({"id":907518,"src":"pescarolo_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_907518.html","width":130,"caption":"Pescarolo Judd, Le Mans 2006","height":76});
															thumbnails[907538] = clik.newPhoto({"id":907538,"src":"poppies_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_907538.html","width":130,"caption":"poppies v2 2006","height":236});
															thumbnails[907539] = clik.newPhoto({"id":907539,"src":"porte_thumb.jpg","galleries_id":69238,"server_id":18,"link":"photo_907539.html","width":130,"caption":"la Pellerie, la Porte","height":93});
															thumbnails[907548] = clik.newPhoto({"id":907548,"src":"st_jean_reflets_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_907548.html","width":130,"caption":"the fisherman, St Jean de la Motte","height":96});
															thumbnails[907550] = clik.newPhoto({"id":907550,"src":"st_jean_trees_thumb.jpg","galleries_id":69238,"server_id":18,"link":"photo_907550.html","width":130,"caption":"sous bois","height":89});
															thumbnails[907555] = clik.newPhoto({"id":907555,"src":"vennevelles_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_907555.html","width":130,"caption":"Vennevelles","height":168});
															thumbnails[908969] = clik.newPhoto({"id":908969,"src":"wells cathedral_thumb.jpg","galleries_id":69238,"server_id":18,"link":"photo_908969.html","width":130,"caption":"wells cathedral","height":86});
															thumbnails[908972] = clik.newPhoto({"id":908972,"src":"st_jean_motte_village_thumb.jpg","galleries_id":69238,"server_id":18,"link":"photo_908972.html","width":130,"caption":"st jean de la motte concours 2005","height":85});
															thumbnails[970605] = clik.newPhoto({"id":970605,"src":"p4 fin_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_970605.html","width":130,"caption":"Ferrari P4, LM1967, ","height":91});
															thumbnails[1101585] = clik.newPhoto({"id":1101585,"src":"rml net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_1101585.html","width":130,"caption":"rml lola 2006","height":77});
															thumbnails[1695748] = clik.newPhoto({"id":1695748,"src":"snow gallery 07_thumb.jpg","galleries_id":69238,"server_id":18,"link":"photo_1695748.html","width":130,"caption":"la galerie à La Pellerie enneigée Fevrier 2007 ","height":88});
															thumbnails[1695798] = clik.newPhoto({"id":1695798,"src":"vieux mans 07net_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_1695798.html","width":130,"caption":"Old Le Mans, le vieux mans","height":179});
															thumbnails[2000638] = clik.newPhoto({"id":2000638,"src":"white roses_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_2000638.html","width":130,"caption":"White roses at Parcé","height":181});
															thumbnails[2002850] = clik.newPhoto({"id":2002850,"src":"image_2_917K_net_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_2002850.html","width":130,"caption":"917 Pedro LM1970","height":88});
															thumbnails[2008886] = clik.newPhoto({"id":2008886,"src":"bas bleus_thumb.jpg","galleries_id":69239,"server_id":18,"link":"photo_2008886.html","width":130,"caption":"bas bleus blue stockings","height":239});
															thumbnails[2008901] = clik.newPhoto({"id":2008901,"src":"redcurrants_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_2008901.html","width":130,"caption":"les groseilles rouges, redcurrants","height":184});
															thumbnails[2030435] = clik.newPhoto({"id":2030435,"src":"Chloe_thumb.jpg","galleries_id":414981,"server_id":18,"link":"photo_2030435.html","width":130,"caption":"Chloé avec son portrait","height":172});
															thumbnails[2030440] = clik.newPhoto({"id":2030440,"src":"250gto web_thumb.jpg","galleries_id":69234,"server_id":18,"link":"photo_2030440.html","width":130,"caption":"250GTO in the Esses 1962","height":174});
															thumbnails[3053260] = clik.newPhoto({"id":3053260,"src":"bentley 4,5LM1927net1_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_3053260.html","width":130,"caption":"Bentley 1927 4.5litre \"Le Mans\"","height":94});
															thumbnails[3053241] = clik.newPhoto({"id":3053241,"src":"Phil Hill LM58 net1_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_3053241.html","width":130,"caption":"Phil Hill LM1958","height":87});
															thumbnails[5891213] = clik.newPhoto({"id":5891213,"src":"lm60_no3_net_59DF05F3-1D09-001F-99CF11F4A792F307_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_5891213.html","width":130,"caption":"Corvette Le Mans 1960","height":84});
															thumbnails[3053543] = clik.newPhoto({"id":3053543,"src":"250gto final net_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_3053543.html","width":130,"caption":"250GTO LM1962","height":174});
															thumbnails[1166224] = clik.newPhoto({"id":1166224,"src":"p4 fin1_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_1166224.html","width":130,"caption":"P4 Ferrari LM1967","height":91});
															thumbnails[5891269] = clik.newPhoto({"id":5891269,"src":"GT40_1968net_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_5891269.html","width":130,"caption":"GT40 Le Mans 1968","height":79});
															thumbnails[3053253] = clik.newPhoto({"id":3053253,"src":"image_2_917K_net1_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_3053253.html","width":130,"caption":"917K LM1970 Pedro Rodriguez","height":88});
															thumbnails[8151590] = clik.newPhoto({"id":8151590,"src":"917lh_net_34EFE33C-1EC9-D45B-1CE9326BD76F5C5C_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_8151590.html","width":130,"caption":"porsche 917lh 1971 24heures du mans","height":80});
															thumbnails[7213994] = clik.newPhoto({"id":7213994,"src":"512BBLM_1981_printnet_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_7213994.html","width":130,"caption":"512BBLM Le Mans 1981","height":77});
															thumbnails[6767179] = clik.newPhoto({"id":6767179,"src":"image_3_jag_net_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_6767179.html","width":130,"caption":"Jaguar TWR Le Mans 1990 ","height":88});
															thumbnails[7902586] = clik.newPhoto({"id":7902586,"src":"mazda_787b_1991net1_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_7902586.html","width":130,"caption":"mazda 787b 24hours 1991","height":86});
															thumbnails[907554] = clik.newPhoto({"id":907554,"src":"tom_7th_win_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_907554.html","width":130,"caption":"Tom 7, Audi 5","height":57});
															thumbnails[1168509] = clik.newPhoto({"id":1168509,"src":"pescarolo1_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_1168509.html","width":130,"caption":"pescarolo judd lm2006","height":76});
															thumbnails[1166199] = clik.newPhoto({"id":1166199,"src":"image4_AM009_net_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_1166199.html","width":130,"caption":"DBR9 ","height":68});
															thumbnails[6380167] = clik.newPhoto({"id":6380167,"src":"tom2008_net_EEE9C51A-24E8-5EC4-4F640475DE403960_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_6380167.html","width":130,"caption":"Tom Kristensen Audi Le Mans 2008","height":75});
															thumbnails[6379834] = clik.newPhoto({"id":6379834,"src":"lmp1_2009_net1_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_6379834.html","width":130,"caption":"Aston Martin LMP1 Le Mans 2009","height":88});
															thumbnails[6379951] = clik.newPhoto({"id":6379951,"src":"oak_racing_no24_lm09net_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_6379951.html","width":130,"caption":"Pescarolo Oak Racing Le Mans 2009","height":70});
															thumbnails[8277173] = clik.newPhoto({"id":8277173,"src":"repro_netv2_thumb.jpg","galleries_id":84294,"server_id":18,"link":"photo_8277173.html","width":130,"caption":"Corvette le mans 24H watercolor","height":82});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[134179] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"New Work","link":"gallery_134179.html","maxRecords":0.0,"photoIDs":[8876135.0,8374899.0,8183311.0,8150223.0,8150565.0,7964441.0,7902580.0,7404691.0],"skipIndex":0,"section_code":"gallery","featured_images":"8374899,7964441,7902580","id":134179,"singleSection":false});				  						galleries[69234] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Cars\/Voitures","link":"gallery_69234.html","maxRecords":0.0,"photoIDs":[6963746.0,6371247.0,5675487.0,4320299.0,3729322.0,2692054.0,2522147.0,2509335.0,907518.0,970605.0,2002850.0,2030440.0],"skipIndex":0,"section_code":"gallery","featured_images":"6963746,6371247,5675487,4320299,3729322,2692054,2522147,2509335,2030440,2002850","id":69234,"singleSection":false});				  						galleries[84294] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Prints\/reproductions","link":"gallery_84294.html","maxRecords":0.0,"photoIDs":[3053260.0,3053241.0,5891213.0,3053543.0,1166224.0,5891269.0,3053253.0,8151590.0,7213994.0,6767179.0,7902586.0,907554.0,1168509.0,1166199.0,6380167.0,6379834.0,6379951.0,8277173.0],"skipIndex":0,"section_code":"gallery","featured_images":"8277173,8151590,7902586,7213994,6767179,6379834,5891213,1166199","id":84294,"singleSection":false});				  						galleries[69238] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Landscapes\/Paysages","link":"gallery_69238.html","maxRecords":0.0,"photoIDs":[5941384.0,4765828.0,4601493.0,3153874.0,907539.0,907550.0,908969.0,908972.0,1695748.0],"skipIndex":0,"section_code":"gallery","featured_images":4765828.0,"id":69238,"singleSection":false});				  						galleries[69239] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Girls\/les Filles","link":"gallery_69239.html","maxRecords":0.0,"photoIDs":[5948682.0,5675518.0,907505.0,2008886.0],"skipIndex":0,"section_code":"gallery","featured_images":5675518.0,"id":69239,"singleSection":false});				  						galleries[414981] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"sold work","link":"gallery_414981.html","maxRecords":0.0,"photoIDs":[8439189.0,8196260.0,8183287.0,8150436.0,8150506.0,6383147.0,5125285.0,5675558.0,5125234.0,4807349.0,4304677.0,4203577.0,4203584.0,3499144.0,2945651.0,2415852.0,907478.0,907488.0,907508.0,907538.0,907548.0,907555.0,1101585.0,1695798.0,2000638.0,2008901.0,2030435.0],"skipIndex":0,"section_code":"gallery","featured_images":"8196260,8183287,8150436,5125285,2415852,907508,907478","id":414981,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8439189,8150506,8151590';
imageSets[2] = '8374899,8196260,8183287,8150436,7964441,7902580,5675518,5125285,4765828,2415852,907508,907478,5891213,8151590,7213994,6767179,7902586,1166199,6379834,8277173';
imageSets[3] = '8196260,5948682';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/raytoombs/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/raytoombs/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = (backgrounds || photos || {})[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Ray Toombs Watercolourist: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
	temp += this.fnGetPaymentInfo();
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp += '<p>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &euro;' + (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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="RAYTOOMBS">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

