window.thumbnails = {};
															thumbnails[198535] = clik.newPhoto({"id":198535,"src":"Re-photographed paintings 006_thumb.jpg","galleries_id":18094,"server_id":18,"link":"photo_198535.html","width":130,"caption":"","height":97});
															thumbnails[198536] = clik.newPhoto({"id":198536,"src":"Re-photographed paintings 008_thumb.jpg","galleries_id":18094,"server_id":18,"link":"photo_198536.html","width":130,"caption":"","height":97});
															thumbnails[198538] = clik.newPhoto({"id":198538,"src":"Re-photographed paintings 009_thumb.jpg","galleries_id":18094,"server_id":18,"link":"photo_198538.html","width":130,"caption":"","height":97});
															thumbnails[198539] = clik.newPhoto({"id":198539,"src":"Re-photographed paintings 013_thumb.jpg","galleries_id":18094,"server_id":18,"link":"photo_198539.html","width":130,"caption":"","height":174});
															thumbnails[198540] = clik.newPhoto({"id":198540,"src":"Re-photographed paintings 016_thumb.jpg","galleries_id":18094,"server_id":18,"link":"photo_198540.html","width":130,"caption":"","height":97});
															thumbnails[198542] = clik.newPhoto({"id":198542,"src":"Re-photographed paintings 0141_thumb.jpg","galleries_id":18094,"server_id":18,"link":"photo_198542.html","width":130,"caption":"","height":97});
															thumbnails[198547] = clik.newPhoto({"id":198547,"src":"marker_thumb.jpg","galleries_id":18094,"server_id":18,"link":"photo_198547.html","width":130,"caption":"","height":118});
															thumbnails[586845] = clik.newPhoto({"id":586845,"src":"rwa_thumb.jpg","galleries_id":86368,"server_id":18,"link":"photo_586845.html","width":130,"caption":"Royal West of England Academy - <br>\r\nAutumn Exhibition Nov 2006","height":170});
															thumbnails[934735] = clik.newPhoto({"id":934735,"src":"Jon standing2_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_934735.html","width":130,"caption":"'Jon Standing'. 200 x 140 cm","height":190});
															thumbnails[934769] = clik.newPhoto({"id":934769,"src":"ClaireGalleries_thumb.jpg","galleries_id":86368,"server_id":18,"link":"photo_934769.html","width":130,"caption":"'Black and White',Claire Galleries 5\/5\/07","height":98});
															thumbnails[934806] = clik.newPhoto({"id":934806,"src":"Two Paintings of Jon_thumb.jpg","galleries_id":18094,"server_id":18,"link":"photo_934806.html","width":130,"caption":"Two paintings of Jon 2007","height":98});
															thumbnails[1670409] = clik.newPhoto({"id":1670409,"src":"'Head No1'Compressed_thumb.jpg","galleries_id":112703,"server_id":18,"link":"photo_1670409.html","width":130,"caption":"'Head No. 1'.<br>\r\nInk and Acrylic on unstretched canvas.<br>\r\n182 x 140cm","height":173});
															thumbnails[1670424] = clik.newPhoto({"id":1670424,"src":"'Head No 2' Compressed_thumb.jpg","galleries_id":112703,"server_id":18,"link":"photo_1670424.html","width":130,"caption":"'Head No. 2' <br>\r\nInk and acrylic on unstreched Canvas.<br>\r\nApprox 210 x 165cm","height":173});
															thumbnails[1670430] = clik.newPhoto({"id":1670430,"src":"Self Portrait 'No3-Compressed_thumb.jpg","galleries_id":112703,"server_id":18,"link":"photo_1670430.html","width":130,"caption":"'Depiction od Self No. 3'.<br>\r\nInk and Acrylic on Canvas,<br>\r\nApprox 210 x 170cm","height":164});
															thumbnails[1670463] = clik.newPhoto({"id":1670463,"src":"'Hand'-Edited_thumb.jpg","galleries_id":112703,"server_id":18,"link":"photo_1670463.html","width":130,"caption":"'Hand'. Ink and Acrylic on Board. 43 x 53 cm","height":101});
															thumbnails[1700289] = clik.newPhoto({"id":1700289,"src":"Byrne Gaunt2Edited_thumb.jpg","galleries_id":86368,"server_id":18,"link":"photo_1700289.html","width":130,"caption":"The Bryrne Gaunt Gallery, 2007","height":98});
															thumbnails[1700290] = clik.newPhoto({"id":1700290,"src":"ByrneGaunt1Edited_thumb.jpg","galleries_id":86368,"server_id":18,"link":"photo_1700290.html","width":130,"caption":"The Byrne Gaunt Gallery 2007","height":98});
															thumbnails[1766882] = clik.newPhoto({"id":1766882,"src":"signal gallery_thumb.jpg","galleries_id":86368,"server_id":18,"link":"photo_1766882.html","width":130,"caption":"The Signal Gallery. Hoxton, London. <br>\r\nOpening Night 10\/11\/08","height":108});
															thumbnails[196306] = clik.newPhoto({"id":196306,"src":"01_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_196306.html","width":130,"caption":"‘Jessika Facing Me’. 171 x 130 cm. <br>\r\nAcrylic, ink and emulsion on Fabriano paper.<br>\r\n","height":178});
															thumbnails[281287] = clik.newPhoto({"id":281287,"src":"NewPaintings-June06 2_thumb.jpg","galleries_id":24952,"server_id":18,"link":"photo_281287.html","width":130,"caption":"'Jack Drawings 1'","height":58});
															thumbnails[3416432] = clik.newPhoto({"id":3416432,"src":"Head of Mike 1-WEB-Jpeg_thumb.jpg","galleries_id":208770,"server_id":18,"link":"photo_3416432.html","width":130,"caption":"","height":185});
															thumbnails[194250] = clik.newPhoto({"id":194250,"src":"2_thumb..jpg","galleries_id":17673,"server_id":18,"link":"photo_194250.html","width":130,"caption":"'Head of Jessika (No1)' . 46.5 x 41 cm. Ink, acrylic and emulsion on paper<br>\r\n","height":149});
															thumbnails[281406] = clik.newPhoto({"id":281406,"src":"NewPaintings-June06 0032_thumb.jpg","galleries_id":24952,"server_id":18,"link":"photo_281406.html","width":130,"caption":"'Drawings of Jack 2'","height":57});
															thumbnails[3416449] = clik.newPhoto({"id":3416449,"src":"Head of Mike 2-WEB_thumb.jpg","galleries_id":208770,"server_id":18,"link":"photo_3416449.html","width":130,"caption":"'Head of Mike 2' 2008. 89.5 x 70 cm approx. Ink and Acrylic on Paper.","height":169});
															thumbnails[196288] = clik.newPhoto({"id":196288,"src":"3_thumb.1.jpg","galleries_id":17673,"server_id":18,"link":"photo_196288.html","width":130,"caption":"‘Jessika Seated’ . 83.5 x 59 cm. <br>\r\nAcrylic, ink and emulsion on paper.<br>\r\n","height":192});
															thumbnails[3147973] = clik.newPhoto({"id":3147973,"src":"HeadofMike4-Lo-Res_thumb.jpg","galleries_id":208770,"server_id":18,"link":"photo_3147973.html","width":130,"caption":"'Head of Mike 4' Ink and acrylic on Paper.","height":182});
															thumbnails[196251] = clik.newPhoto({"id":196251,"src":"8_thumb.1.JPG","galleries_id":17673,"server_id":18,"link":"photo_196251.html","width":130,"caption":"‘Dave in corner’ . 83.5 x 59 cm. <br>\r\nAcrylic and ink on paper.<br>\r\n","height":178});
															thumbnails[281381] = clik.newPhoto({"id":281381,"src":"NewPaintings-June06 0071_thumb.jpg","galleries_id":24952,"server_id":18,"link":"photo_281381.html","width":130,"caption":"'Georgia No.2' . Ink and Acylic on Paper","height":127});
															thumbnails[3416452] = clik.newPhoto({"id":3416452,"src":"Head of Mike 3-WEB-Jpeg_thumb.jpg","galleries_id":208770,"server_id":18,"link":"photo_3416452.html","width":130,"caption":"'Head of Mike 3' 2008. 65.7 x 50 cm. Ink and Acrylic on Paper.","height":172});
															thumbnails[196239] = clik.newPhoto({"id":196239,"src":"6_thumb.2.jpg","galleries_id":17673,"server_id":18,"link":"photo_196239.html","width":130,"caption":"‘Jon Standing with Chair’ . 83.5 x 59 cm.<br>\r\nAcrylic, ink and emulsion on paper.<br>\r\n","height":176});
															thumbnails[281401] = clik.newPhoto({"id":281401,"src":"Edited_thumb.jpg","galleries_id":24952,"server_id":18,"link":"photo_281401.html","width":130,"caption":"'Georgia No.3'. Ink and Acrylic on Paper.","height":98});
															thumbnails[3416460] = clik.newPhoto({"id":3416460,"src":"Head of George 1-WEB-jPeg_thumb.jpg","galleries_id":208770,"server_id":18,"link":"photo_3416460.html","width":130,"caption":"'Head of George 1' 2008. 99.4 x 70 cm. Ink and Acrylic on Paper.","height":184});
															thumbnails[196194] = clik.newPhoto({"id":196194,"src":"7_thumb..jpg","galleries_id":17673,"server_id":18,"link":"photo_196194.html","width":130,"caption":"'Jon kneeling' . 83.5 x 59 cm.<br>\r\nInk and acrylic on paper.","height":173});
															thumbnails[281397] = clik.newPhoto({"id":281397,"src":"'Georgia No_thumb. 1'.JPG","galleries_id":24952,"server_id":18,"link":"photo_281397.html","width":130,"caption":"'Georgia No. 1' . Ink and Acrylic on Paper.","height":176});
															thumbnails[3416467] = clik.newPhoto({"id":3416467,"src":"Head of Donald 6-WEB-JPEG_thumb.jpg","galleries_id":208770,"server_id":18,"link":"photo_3416467.html","width":130,"caption":"'Head of Donald 6' 2008. 99.2 x 70.5 cm. Ink and Acrylic on Paper.","height":183});
															thumbnails[196262] = clik.newPhoto({"id":196262,"src":"4_thumb.1.jpg","galleries_id":17673,"server_id":18,"link":"photo_196262.html","width":130,"caption":"‘Rebecca Standing’ . 83.5 x 59 cm.<br>\r\nAcrylic, ink and emulsion on paper.<br>\r\n","height":185});
															thumbnails[281374] = clik.newPhoto({"id":281374,"src":"NewPaintings-June06 0051_thumb.jpg","galleries_id":24952,"server_id":18,"link":"photo_281374.html","width":130,"caption":"'Tryptich of Jack'. ","height":57});
															thumbnails[3416470] = clik.newPhoto({"id":3416470,"src":"Head of George 2-WEB-JPeg_thumb.jpg","galleries_id":208770,"server_id":18,"link":"photo_3416470.html","width":130,"caption":"'Head of George 2' 2008. 79 x 49.4 cm. Ink and Acrylic on Paper.","height":210});
															thumbnails[196083] = clik.newPhoto({"id":196083,"src":"5_thumb..jpg","galleries_id":17673,"server_id":18,"link":"photo_196083.html","width":130,"caption":"'Rebecca Kneeling'. 83.5 x 59 cm.<br>\r\nInk, acrylic and emulsion on paper.","height":181});
															thumbnails[196233] = clik.newPhoto({"id":196233,"src":"14 -'Dyptych of Jessika' 2006_thumb. Silscreen Print. Each image approx. 30 x 23.5 cm1.jpg","galleries_id":24952,"server_id":18,"link":"photo_196233.html","width":130,"caption":"‘Diptych of Jessika’. Silkscreen Print.<br>\r\nEach image approx. 30 x 23.5 cm.<br>\r\n","height":83});
															thumbnails[1204931] = clik.newPhoto({"id":1204931,"src":"Jon Profile_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_1204931.html","width":130,"caption":"'Jon Profile'. 83.5 x 59 cm. Ink and acrylic on Paper. ","height":192});
															thumbnails[3416472] = clik.newPhoto({"id":3416472,"src":"Head of Mike 5-Collaborative 1-WEB-Jpeg_thumb.jpg","galleries_id":208770,"server_id":18,"link":"photo_3416472.html","width":130,"caption":"'Head of Mike 5' 2008. 74.7 x 57 cm. Ink and Acrylic on Paper.","height":170});
															thumbnails[196095] = clik.newPhoto({"id":196095,"src":"9_thumb..jpg","galleries_id":17673,"server_id":18,"link":"photo_196095.html","width":130,"caption":"'Jessika Standing'. 152.4 x 119.3 cm.<br>\r\nInk and acrylic on board.","height":168});
															thumbnails[196137] = clik.newPhoto({"id":196137,"src":"beccaa_thumb.jpg","galleries_id":24952,"server_id":18,"link":"photo_196137.html","width":130,"caption":"'Rebecca Standing' . Silkscreen Print. <br>\r\n42 x 30 cm (approx).","height":188});
															thumbnails[1205298] = clik.newPhoto({"id":1205298,"src":"Silkscreen print Jon 003_thumb.jpg","galleries_id":24952,"server_id":18,"link":"photo_1205298.html","width":130,"caption":"'Jon Facing Me' Screenprint 200 x 140 cm","height":184});
															thumbnails[3416475] = clik.newPhoto({"id":3416475,"src":"Head of Mike 6- Collaborative2-WEB-Jpeg_thumb.jpg","galleries_id":208770,"server_id":18,"link":"photo_3416475.html","width":130,"caption":"'Head of Mike 6' 2008. 74.5 x 56.5 cm. Ink and Acrylic on Paper.","height":173});
															thumbnails[196099] = clik.newPhoto({"id":196099,"src":"11_thumb..JPG","galleries_id":17673,"server_id":18,"link":"photo_196099.html","width":130,"caption":"'Jessika sitting with legs streched out'<br>\r\n182 x 121 cm. Ink and acrylic on board.","height":202});
															thumbnails[1544648] = clik.newPhoto({"id":1544648,"src":"Self Portrait 2007 - Monoprint_thumb.jpg","galleries_id":24952,"server_id":18,"link":"photo_1544648.html","width":130,"caption":"'Self Portrait 1'. Monoprint. 13 x 12.5 cm","height":138});
															thumbnails[196208] = clik.newPhoto({"id":196208,"src":"18_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_196208.html","width":130,"caption":"'Jessika with arms streched out'. <br>\r\n121 x 121 cm. Ink and acrylic on board.","height":131});
															thumbnails[1775984] = clik.newPhoto({"id":1775984,"src":"'Head of Will' 2001(cropped)Edited_thumb.jpg","galleries_id":24952,"server_id":18,"link":"photo_1775984.html","width":130,"caption":"'Head of Will' Drypoint Etching 3\/3","height":132});
															thumbnails[196115] = clik.newPhoto({"id":196115,"src":"12_thumb..jpg","galleries_id":17673,"server_id":18,"link":"photo_196115.html","width":130,"caption":"'Rebecca bending over chair'. 121 x 121 cm<br>\r\nIn, acrylic and emulsion on board. ","height":131});
															thumbnails[196121] = clik.newPhoto({"id":196121,"src":"13_thumb..jpg","galleries_id":17673,"server_id":18,"link":"photo_196121.html","width":130,"caption":"'Jessika in chair'. 208 x 147 cm.<br>\r\nInk and acrylic on board. ","height":181});
															thumbnails[1205175] = clik.newPhoto({"id":1205175,"src":"JonRearView_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_1205175.html","width":130,"caption":"'Jon - Rear View' . Ink and acrylic on paper.","height":196});
															thumbnails[1562370] = clik.newPhoto({"id":1562370,"src":"'Jon Sitting (Front View)' 2007_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_1562370.html","width":130,"caption":"'Jon Sitting - Front View' . Ink and Acrylic on Paper ","height":183});
															thumbnails[1625188] = clik.newPhoto({"id":1625188,"src":"New Dave_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_1625188.html","width":130,"caption":"'Dave Facing Me' ","height":201});
															thumbnails[1641815] = clik.newPhoto({"id":1641815,"src":"'Will Standing With Arms Out' 2007_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_1641815.html","width":130,"caption":"'Will Standing with Arms out' 83.5 x 59cm<br>\r\n","height":187});
															thumbnails[1878078] = clik.newPhoto({"id":1878078,"src":"'Head of Jon' -30x28cm-Acryliconboard_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_1878078.html","width":130,"caption":"'Head of Jon'. 30 x 28cm. Acrylic and ink on board.","height":143});
															thumbnails[2211532] = clik.newPhoto({"id":2211532,"src":"'Head of Jon 2' 2008_thumb. 70 x 49.6 cm. Mixed media on paper..jpg","galleries_id":17673,"server_id":18,"link":"photo_2211532.html","width":130,"caption":"'Head of Jon 2' . 70 x 49.6 cm. Mixed media on paper.","height":182});
															thumbnails[1949386] = clik.newPhoto({"id":1949386,"src":"'Head of Donald' 83x59cm3_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_1949386.html","width":130,"caption":"'Head of Donanald' 83.5 x 59 cm. Ink and acrylic on paper. ","height":173});
															thumbnails[2211944] = clik.newPhoto({"id":2211944,"src":"'Head of Jon 3' 2008COMPRESSED_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_2211944.html","width":130,"caption":"'Head of Jon 3'. 83 x 59cm. Mixed media on Paper.","height":191});
															thumbnails[2211946] = clik.newPhoto({"id":2211946,"src":"HofDonald2-Compressed_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_2211946.html","width":130,"caption":"'Head of Donald 2'. 83x59cm. Ink and Acrylic on Paper.","height":182});
															thumbnails[2211948] = clik.newPhoto({"id":2211948,"src":"'Head of Donald 3' COMPRESSED_thumb.jpg","galleries_id":17673,"server_id":18,"link":"photo_2211948.html","width":130,"caption":"'Head of Donald 3' . 83x59cm. Ink and Acrylic on Paper.","height":183});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[112703] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Past Work","link":"gallery_112703.html","maxRecords":0.0,"photoIDs":[1670409.0,1670424.0,1670430.0,1670463.0],"skipIndex":0,"section_code":"gallery","featured_images":"1670430,1670424,1670409","id":112703,"singleSection":false});				  						galleries[17673] = clik.newGallery({"parentGallery":"","usePopups":false,"title":" Recent Paintings","link":"gallery_17673.html","maxRecords":0.0,"photoIDs":[934735.0,196306.0,194250.0,196288.0,196251.0,196239.0,196194.0,196262.0,196083.0,1204931.0,196095.0,196099.0,196208.0,196115.0,196121.0,1205175.0,1562370.0,1625188.0,1641815.0,1878078.0,2211532.0,1949386.0,2211944.0,2211946.0,2211948.0],"skipIndex":0,"section_code":"gallery","featured_images":"934735,196306,196288","id":17673,"singleSection":false});				  						galleries[208770] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"New Paintings","link":"gallery_208770.html","maxRecords":0.0,"photoIDs":[3416432.0,3416449.0,3147973.0,3416452.0,3416460.0,3416467.0,3416470.0,3416472.0,3416475.0],"skipIndex":0,"section_code":"gallery","featured_images":3147973.0,"id":208770,"singleSection":false});				  						galleries[24952] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Drawings & Prints","link":"gallery_24952.html","maxRecords":0.0,"photoIDs":[281287.0,281406.0,281381.0,281401.0,281397.0,281374.0,196233.0,196137.0,1205298.0,1544648.0,1775984.0],"skipIndex":0,"section_code":"gallery","featured_images":"1205298,196233","id":24952,"singleSection":false});				  						galleries[86368] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Exhibition Photographs","link":"gallery_86368.html","maxRecords":0.0,"photoIDs":[586845.0,934769.0,1700289.0,1700290.0,1766882.0],"skipIndex":0,"section_code":"gallery","featured_images":586845.0,"id":86368,"singleSection":false});				  						galleries[18094] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Studio ","link":"gallery_18094.html","maxRecords":0.0,"photoIDs":[198535.0,198536.0,198538.0,198539.0,198540.0,198542.0,198547.0,934806.0],"skipIndex":0,"section_code":"gallery","featured_images":"934806,198542,198540","id":18094,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3416432,3416449,3147973,3416452,3416460';
imageSets[2] = '1670430,1670424,1670409,934806,934735,586845,198542,198540,196306,3147973,196288,196233,1205298';
imageSets[3] = '3416475,3416472,3416470,3416467,3416460,3416452,3416449,3416432,3147973,2211948,2211946,2211944,2211532,1949386,1878078,1775984,1766882,1700290,1700289,1670463,1670430,1670424,1670409,1641815,1625188,1562370,1544648,1205298,1205175,1204931,934806,934769,934735,586845,281406,281401,281397,281381,281374,281287,198547,198542,198540,198539,198538,198536,198535,196306,196288,196262';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/hspaintings/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/hspaintings/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:'',$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 = 'HARRY SIMMONDS Paintings: ' + 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> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.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="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		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" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="harry_simmonds1@hotmail.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="harry_simmonds1@hotmail.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

