window.thumbnails = {};
															thumbnails[8228412] = clik.newPhoto({"id":8228412,"src":"DSC_0017_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Cloud River Sea detail","height":87});
															thumbnails[1571027] = clik.newPhoto({"id":1571027,"src":"black-reflections-corrected_thumb.jpg","galleries_id":81125,"server_id":1,"link":"photo_1571027.html","width":130,"caption":"dark reflection","height":102});
															thumbnails[2127897] = clik.newPhoto({"id":2127897,"src":"Sea Bed_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_2127897.html","width":130,"caption":"sea bed","height":82});
															thumbnails[2127953] = clik.newPhoto({"id":2127953,"src":"The Swimming Pool for web_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_2127953.html","width":130,"caption":"swimming pool","height":87});
															thumbnails[3028126] = clik.newPhoto({"id":3028126,"src":"from the series salt and oil_thumb.jpg","galleries_id":81127,"server_id":1,"link":"photo_3028126.html","width":130,"caption":"from the series salt and oil","height":87});
															thumbnails[3028131] = clik.newPhoto({"id":3028131,"src":"Look-a-little-closer_thumb.jpg","galleries_id":422839,"server_id":1,"link":"photo_3028131.html","width":130,"caption":"look a little closer","height":101});
															thumbnails[3029364] = clik.newPhoto({"id":3029364,"src":"DSC_0035_thumb.jpg","galleries_id":422839,"server_id":1,"link":"photo_3029364.html","width":130,"caption":"look a little closer","height":87});
															thumbnails[7070280] = clik.newPhoto({"id":7070280,"src":"tank_sculpture_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_7070280.html","width":130,"caption":"refract","height":198});
															thumbnails[7088337] = clik.newPhoto({"id":7088337,"src":"Denbigh_4_for_web_thumb.jpg","galleries_id":383835,"server_id":1,"link":"photo_7088337.html","width":130,"caption":"Rising Slowly","height":86});
															thumbnails[7834548] = clik.newPhoto({"id":7834548,"src":"square_river_mix.web_thumb.jpg","galleries_id":422821,"server_id":1,"link":"photo_7834548.html","width":130,"caption":"Vennar River","height":130});
															thumbnails[7834907] = clik.newPhoto({"id":7834907,"src":"Cloud_River_Sea_closerweb1_thumb.jpg","galleries_id":422837,"server_id":1,"link":"photo_7834907.html","width":130,"caption":"","height":91});
															thumbnails[7834908] = clik.newPhoto({"id":7834908,"src":"CRS_detail_3web_thumb.jpg","galleries_id":422837,"server_id":1,"link":"photo_7834908.html","width":130,"caption":"","height":74});
															thumbnails[7834910] = clik.newPhoto({"id":7834910,"src":"CRS_detail_4_thumb.jpg","galleries_id":422837,"server_id":1,"link":"photo_7834910.html","width":130,"caption":"","height":87});
															thumbnails[7834911] = clik.newPhoto({"id":7834911,"src":"CRS_detail.web_thumb.jpg","galleries_id":422837,"server_id":1,"link":"photo_7834911.html","width":130,"caption":"","height":87});
															thumbnails[7834912] = clik.newPhoto({"id":7834912,"src":"CRS_detail2.web_thumb.jpg","galleries_id":422837,"server_id":1,"link":"photo_7834912.html","width":130,"caption":"","height":206});
															thumbnails[7834913] = clik.newPhoto({"id":7834913,"src":"CRS_detail5.web_thumb.jpg","galleries_id":422837,"server_id":1,"link":"photo_7834913.html","width":130,"caption":"","height":194});
															thumbnails[7834915] = clik.newPhoto({"id":7834915,"src":"longest_day_difference.web_thumb.jpg","galleries_id":422821,"server_id":1,"link":"photo_7834915.html","width":130,"caption":"","height":183});
															thumbnails[8228432] = clik.newPhoto({"id":8228432,"src":"transforming_light_thumb.jpg","galleries_id":383824,"server_id":1,"link":"photo_8228432.html","width":130,"caption":"transforming light - video still","height":98});
															thumbnails[8228441] = clik.newPhoto({"id":8228441,"src":"Longest_day_shortest_day_comp2_thumb.jpg","galleries_id":422804,"server_id":1,"link":"photo_8228441.html","width":130,"caption":"Longest day, shortest day (on the edge)","height":92});
															thumbnails[7070291] = clik.newPhoto({"id":7070291,"src":"Rising_slowly_2a_thumb.jpg","galleries_id":383824,"server_id":1,"link":"photo_7070291.html","width":130,"caption":"","height":73});
															thumbnails[7834536] = clik.newPhoto({"id":7834536,"src":"Akkara_plantation.web_thumb.jpg","galleries_id":422821,"server_id":1,"link":"photo_7834536.html","width":130,"caption":"Akkara plantation","height":98});
															thumbnails[1613092] = clik.newPhoto({"id":1613092,"src":"ravishing2_thumb.jpg","galleries_id":109718,"server_id":1,"link":"photo_1613092.html","width":130,"caption":"ravishing 2","height":176});
															thumbnails[4931502] = clik.newPhoto({"id":4931502,"src":"On-the-brink-stills_thumb.jpg","galleries_id":280655,"server_id":1,"link":"photo_4931502.html","width":130,"caption":"On the Brink","height":66});
															thumbnails[7834335] = clik.newPhoto({"id":7834335,"src":"LDSD_web1_thumb.jpg","galleries_id":422804,"server_id":1,"link":"photo_7834335.html","width":130,"caption":"Longest day, shortest day, (reflections)","height":92});
															thumbnails[7834542] = clik.newPhoto({"id":7834542,"src":"munnar_rose.web_thumb.jpg","galleries_id":422821,"server_id":1,"link":"photo_7834542.html","width":130,"caption":"Munnar rose","height":87});
															thumbnails[1613093] = clik.newPhoto({"id":1613093,"src":"ravishing-back_thumb.jpg","galleries_id":109718,"server_id":1,"link":"photo_1613093.html","width":130,"caption":"ravishing 3","height":94});
															thumbnails[4253075] = clik.newPhoto({"id":4253075,"src":"video_stills_thumb.jpg","galleries_id":383824,"server_id":1,"link":"photo_4253075.html","width":130,"caption":"","height":41});
															thumbnails[4931509] = clik.newPhoto({"id":4931509,"src":"Stills-detail_thumb.jpg","galleries_id":280655,"server_id":1,"link":"photo_4931509.html","width":130,"caption":"On the Brink stills","height":57});
															thumbnails[1613094] = clik.newPhoto({"id":1613094,"src":"ravishing4_thumb.jpg","galleries_id":109718,"server_id":1,"link":"photo_1613094.html","width":130,"caption":"ravishing 4","height":198});
															thumbnails[4931500] = clik.newPhoto({"id":4931500,"src":"In-my-beginning_thumb.jpg","galleries_id":383824,"server_id":1,"link":"photo_4931500.html","width":130,"caption":"In my beginning is my end","height":86});
															thumbnails[4931511] = clik.newPhoto({"id":4931511,"src":"Rising-Slowly-web_thumb.jpg","galleries_id":280655,"server_id":1,"link":"photo_4931511.html","width":130,"caption":"Rising Slowly","height":63});
															thumbnails[1613095] = clik.newPhoto({"id":1613095,"src":"ravishing-5_thumb.jpg","galleries_id":109718,"server_id":1,"link":"photo_1613095.html","width":130,"caption":" ravishing 5","height":87});
															thumbnails[4931496] = clik.newPhoto({"id":4931496,"src":"3mm-per-year_thumb.jpg","galleries_id":280655,"server_id":1,"link":"photo_4931496.html","width":130,"caption":"3mm per year","height":78});
															thumbnails[7834763] = clik.newPhoto({"id":7834763,"src":"Vennar_River_triple_thumb.jpg","galleries_id":422821,"server_id":1,"link":"photo_7834763.html","width":130,"caption":"","height":296});
															thumbnails[4931503] = clik.newPhoto({"id":4931503,"src":"open-sketchbook_thumb.jpg","galleries_id":280655,"server_id":1,"link":"photo_4931503.html","width":130,"caption":"Bardsey sketchbook","height":83});
															thumbnails[4931506] = clik.newPhoto({"id":4931506,"src":"sketchbook-detail-worked_thumb.jpg","galleries_id":280655,"server_id":1,"link":"photo_4931506.html","width":130,"caption":"Bardsey sketchbook ","height":87});
															thumbnails[4931501] = clik.newPhoto({"id":4931501,"src":"Making-islands_thumb.jpg","galleries_id":280655,"server_id":1,"link":"photo_4931501.html","width":130,"caption":"Making islands","height":52});
															thumbnails[1104280] = clik.newPhoto({"id":1104280,"src":"lightbox_thumb.jpg","galleries_id":81127,"server_id":1,"link":"photo_1104280.html","width":130,"caption":"herbacious","height":183});
															thumbnails[1104318] = clik.newPhoto({"id":1104318,"src":"tree_hugging_thumb.jpg","galleries_id":81127,"server_id":1,"link":"photo_1104318.html","width":130,"caption":"back to back ","height":186});
															thumbnails[1104331] = clik.newPhoto({"id":1104331,"src":"The-Swimming-Party-41_thumb.jpg","galleries_id":81152,"server_id":1,"link":"photo_1104331.html","width":130,"caption":"backstroke","height":98});
															thumbnails[1107787] = clik.newPhoto({"id":1107787,"src":"Variable-Contrast-light_thumb.jpg","galleries_id":422838,"server_id":1,"link":"photo_1107787.html","width":130,"caption":"variable contrast, light side","height":98});
															thumbnails[3209202] = clik.newPhoto({"id":3209202,"src":"Sea-Breathing-OD-web_thumb.jpg","galleries_id":280656,"server_id":1,"link":"photo_3209202.html","width":130,"caption":"Sea Breathing","height":119});
															thumbnails[7070272] = clik.newPhoto({"id":7070272,"src":"incredible3.for_web_thumb.jpg","galleries_id":383824,"server_id":1,"link":"photo_7070272.html","width":130,"caption":"","height":98});
															thumbnails[1104288] = clik.newPhoto({"id":1104288,"src":"looking_forward_looking_back_thumb.jpg","galleries_id":81125,"server_id":1,"link":"photo_1104288.html","width":130,"caption":"looking forward looking back","height":98});
															thumbnails[1104314] = clik.newPhoto({"id":1104314,"src":"ravishing_1_thumb.jpg","galleries_id":109718,"server_id":1,"link":"photo_1104314.html","width":130,"caption":"ravishing 1","height":93});
															thumbnails[1104333] = clik.newPhoto({"id":1104333,"src":"the-swimming-party-kicking_thumb.jpg","galleries_id":81152,"server_id":1,"link":"photo_1104333.html","width":130,"caption":"back kick","height":100});
															thumbnails[1107784] = clik.newPhoto({"id":1107784,"src":"Variable-Contrast_thumb.jpg","galleries_id":422838,"server_id":1,"link":"photo_1107784.html","width":130,"caption":"variable contrast","height":163});
															thumbnails[1107832] = clik.newPhoto({"id":1107832,"src":"slate-walk1_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_1107832.html","width":130,"caption":"slate walk","height":59});
															thumbnails[1104275] = clik.newPhoto({"id":1104275,"src":"corner_transparency_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_1104275.html","width":130,"caption":"corner piece","height":194});
															thumbnails[1104342] = clik.newPhoto({"id":1104342,"src":"the-swimming-party-starfloa_thumb.jpg","galleries_id":81152,"server_id":1,"link":"photo_1104342.html","width":130,"caption":"starfloat","height":98});
															thumbnails[1107789] = clik.newPhoto({"id":1107789,"src":"Variable-Contrast-dark_thumb.jpg","galleries_id":422838,"server_id":1,"link":"photo_1107789.html","width":130,"caption":"variable contrast, dark side","height":173});
															thumbnails[1104230] = clik.newPhoto({"id":1104230,"src":"footsteps_thumb.jpg","galleries_id":422839,"server_id":1,"link":"photo_1104230.html","width":130,"caption":"a walk in the woods","height":194});
															thumbnails[1104294] = clik.newPhoto({"id":1104294,"src":"mirror_displacement_trees_thumb.jpg","galleries_id":81125,"server_id":1,"link":"photo_1104294.html","width":130,"caption":"light in dark places","height":93});
															thumbnails[1104317] = clik.newPhoto({"id":1104317,"src":"senses_thumb.jpg","galleries_id":81124,"server_id":1,"link":"photo_1104317.html","width":130,"caption":"two of the five senses","height":50});
															thumbnails[1104374] = clik.newPhoto({"id":1104374,"src":"the-swimming-party-backfloa1_thumb.jpg","galleries_id":81152,"server_id":1,"link":"photo_1104374.html","width":130,"caption":"backfloat","height":98});
															thumbnails[1107743] = clik.newPhoto({"id":1107743,"src":"silver-darlings_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_1107743.html","width":130,"caption":"silver darlings, detail","height":194});
															thumbnails[1107761] = clik.newPhoto({"id":1107761,"src":"woods-footstep_thumb.jpg","galleries_id":422839,"server_id":1,"link":"photo_1107761.html","width":130,"caption":"a walk in the woods","height":194});
															thumbnails[1107689] = clik.newPhoto({"id":1107689,"src":"flotsam-jetsam_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_1107689.html","width":130,"caption":"flotsam and jetsam 1","height":125});
															thumbnails[1107756] = clik.newPhoto({"id":1107756,"src":"swimming2_thumb.jpg","galleries_id":81152,"server_id":1,"link":"photo_1107756.html","width":130,"caption":"breast stroke","height":98});
															thumbnails[1143140] = clik.newPhoto({"id":1143140,"src":"second year textiles_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_1143140.html","width":130,"caption":"untitled","height":173});
															thumbnails[1104301] = clik.newPhoto({"id":1104301,"src":"mirror_displacement_thumb.jpg","galleries_id":81125,"server_id":1,"link":"photo_1104301.html","width":130,"caption":"being there","height":96});
															thumbnails[1108080] = clik.newPhoto({"id":1108080,"src":"flotsam-and-jetsam2_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_1108080.html","width":130,"caption":"flotsam and jetsam 2","height":194});
															thumbnails[1104302] = clik.newPhoto({"id":1104302,"src":"round-mirror-displacement_thumb.jpg","galleries_id":81125,"server_id":1,"link":"photo_1104302.html","width":130,"caption":"above and below","height":105});
															thumbnails[1108077] = clik.newPhoto({"id":1108077,"src":"Lido_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_1108077.html","width":130,"caption":"lido","height":81});
															thumbnails[1108066] = clik.newPhoto({"id":1108066,"src":"Visceral_thumb.jpg","galleries_id":81123,"server_id":1,"link":"photo_1108066.html","width":130,"caption":"close up","height":57});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[383835] = clik.newGallery({"parentGallery":280654,"usePopups":false,"title":"Denbigh","link":"gallery_383835.html","maxRecords":0.0,"photoIDs":[7088337.0],"skipIndex":0,"section_code":"gallery","featured_images":7088337.0,"id":383835,"singleSection":false});				  						galleries[280655] = clik.newGallery({"parentGallery":280654,"usePopups":false,"title":"On the Brink, Holyhead","link":"gallery_280655.html","maxRecords":0.0,"photoIDs":[4931502.0,4931509.0,4931511.0,4931496.0,4931503.0,4931506.0,4931501.0],"skipIndex":0,"section_code":"gallery","featured_images":"4931511,4931509,4931506,4931503,4931502,4931501,4931496","id":280655,"singleSection":false});				  						galleries[280656] = clik.newGallery({"parentGallery":280654,"usePopups":false,"title":"Sea breathing","link":"gallery_280656.html","maxRecords":0.0,"photoIDs":[3209202.0],"skipIndex":0,"section_code":"gallery","featured_images":3209202.0,"id":280656,"singleSection":false});				  						galleries[422837] = clik.newGallery({"parentGallery":422836,"usePopups":false,"title":"Cloud\/river\/sea","link":"gallery_422837.html","maxRecords":0.0,"photoIDs":[7834907.0,7834908.0,7834910.0,7834911.0,7834912.0,7834913.0],"skipIndex":0,"section_code":"gallery","featured_images":"7834913,7834912,7834911,7834910,7834908,7834907","id":422837,"singleSection":false});				  						galleries[422804] = clik.newGallery({"parentGallery":80851,"usePopups":false,"title":"Longest Day, Shortest Day","link":"gallery_422804.html","maxRecords":0.0,"photoIDs":[8228441.0,7834335.0],"skipIndex":0,"section_code":"gallery","featured_images":"8228441,7834335","id":422804,"singleSection":false});				  						galleries[422838] = clik.newGallery({"parentGallery":422836,"usePopups":false,"title":"Degree show","link":"gallery_422838.html","maxRecords":0.0,"photoIDs":[1107787.0,1107784.0,1107789.0],"skipIndex":0,"section_code":"gallery","featured_images":1107787.0,"id":422838,"singleSection":false});				  						galleries[81125] = clik.newGallery({"parentGallery":80851,"usePopups":false,"title":"Mirror displacements","link":"gallery_81125.html","maxRecords":0.0,"photoIDs":[1571027.0,1104288.0,1104294.0,1104301.0,1104302.0],"skipIndex":0,"section_code":"gallery","featured_images":"1571027,1104302,1104301,1104294,1104288","id":81125,"singleSection":false});				  						galleries[422839] = clik.newGallery({"parentGallery":422836,"usePopups":false,"title":"other installations","link":"gallery_422839.html","maxRecords":0.0,"photoIDs":[3028131.0,3029364.0,1104230.0,1107761.0],"skipIndex":0,"section_code":"gallery","featured_images":"3029364,3028131,1107761,1104230","id":422839,"singleSection":false});				  						galleries[109718] = clik.newGallery({"parentGallery":80851,"usePopups":false,"title":"Ravishing","link":"gallery_109718.html","maxRecords":0.0,"photoIDs":[1613092.0,1613093.0,1613094.0,1613095.0,1104314.0],"skipIndex":0,"section_code":"gallery","featured_images":1613093.0,"id":109718,"singleSection":false});				  						galleries[81127] = clik.newGallery({"parentGallery":80851,"usePopups":false,"title":"Experimental","link":"gallery_81127.html","maxRecords":0.0,"photoIDs":[3028126.0,1104280.0,1104318.0],"skipIndex":0,"section_code":"gallery","featured_images":"3028126,1104318,1104280","id":81127,"singleSection":false});				  						galleries[81152] = clik.newGallery({"parentGallery":80851,"usePopups":false,"title":"The swimming party","link":"gallery_81152.html","maxRecords":0.0,"photoIDs":[1104331.0,1104333.0,1104342.0,1104374.0,1107756.0],"skipIndex":0,"section_code":"gallery","featured_images":"1104374,1104331","id":81152,"singleSection":false});				  						galleries[422821] = clik.newGallery({"parentGallery":80851,"usePopups":false,"title":"Photographs with drawings","link":"gallery_422821.html","maxRecords":0.0,"photoIDs":[7834548.0,7834915.0,7834536.0,7834542.0,7834763.0],"skipIndex":0,"section_code":"gallery","featured_images":"7834915,7834763,7834548,7834542,7834536","id":422821,"singleSection":false});				  						galleries[81124] = clik.newGallery({"parentGallery":80851,"usePopups":false,"title":"Miscellany","link":"gallery_81124.html","maxRecords":0.0,"photoIDs":[1104317.0],"skipIndex":0,"section_code":"gallery","featured_images":1104317.0,"id":81124,"singleSection":false});				  						galleries[280654] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Recent exhibitions","link":"gallery_280654.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"7088337,4931511,4931509,4931506,4931503,4931502,4931501,4931496,3209202","id":280654,"singleSection":false});				  						galleries[422836] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Installation","link":"gallery_422836.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":1107787.0,"id":422836,"singleSection":false});				  						galleries[383824] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Video works","link":"gallery_383824.html","maxRecords":0.0,"photoIDs":[8228432.0,7070291.0,4253075.0,4931500.0,7070272.0],"skipIndex":0,"section_code":"gallery","featured_images":"8228432,7070291,7070272,4931500,4253075","id":383824,"singleSection":false});				  						galleries[81123] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photographs as sculpture","link":"gallery_81123.html","maxRecords":0.0,"photoIDs":[2127897.0,2127953.0,7070280.0,1107832.0,1104275.0,1107743.0,1107689.0,1143140.0,1108080.0,1108077.0,1108066.0],"skipIndex":0,"section_code":"gallery","featured_images":"1107832,1107689","id":81123,"singleSection":false});				  						galleries[80851] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photographs","link":"gallery_80851.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"1613093,1104374,1104331,1104317","id":80851,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8228432';
imageSets[2] = '1613093,1107787,1104331,1107832,1104374,1104317,1107689';
imageSets[3] = '8228441,8228432,8228412,7834915,7834913,7834912,7834911,7834910,7834908,7834907,7834763,7834548,7834542,7834536,7834335,7088337,7070291,7070280,7070272,4931511,4931509,4931506,4931503,4931502,4931501,4931500,4931496,4253075,3209202,3029364,3028131,3028126,2127953,2127897,1613095,1613094,1613093,1613092,1571027,1143140,1108080,1108077,1108066,1107832,1107789,1107787,1107784,1107761,1107756,1107743';
imageSets[242192] = '8228432,8228412,7070291,7834542,7834335';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/hgrovewhite/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/hgrovewhite/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 = 'Helen Grove-White: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

