window.thumbnails = {};
															thumbnails[5383392] = clik.newPhoto({"id":5383392,"src":"Img6474_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"A Clamour of Rooks","height":62});
															thumbnails[5791647] = clik.newPhoto({"id":5791647,"src":"meandbuilders_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Very Tired Builders","height":94});
															thumbnails[5791649] = clik.newPhoto({"id":5791649,"src":"opening1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Gallery Opening","height":80});
															thumbnails[6487992] = clik.newPhoto({"id":6487992,"src":"web_avocet_gallery_2_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"The opening of our new exhibition","height":81});
															thumbnails[8215029] = clik.newPhoto({"id":8215029,"src":"Little_Terns_web_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Little Terns","height":131});
															thumbnails[8215032] = clik.newPhoto({"id":8215032,"src":"shellsweb_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Free embroidery brooches","height":91});
															thumbnails[8215034] = clik.newPhoto({"id":8215034,"src":"netmoonweb_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Netting the Moon","height":163});
															thumbnails[8250107] = clik.newPhoto({"id":8250107,"src":"ruthseaglasswb_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"sea glass jewellery","height":73});
															thumbnails[8250114] = clik.newPhoto({"id":8250114,"src":"stuartchesterweb_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Stuart Chester's driftwood sculpture","height":123});
															thumbnails[5363384] = clik.newPhoto({"id":5363384,"src":"bluetitswb_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_5363384.html","width":130,"caption":"Blue Tits","height":160});
															thumbnails[5363394] = clik.newPhoto({"id":5363394,"src":"bullfincheswb_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_5363394.html","width":130,"caption":"Bullfinches","height":141});
															thumbnails[5363408] = clik.newPhoto({"id":5363408,"src":"greenfincheswb_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_5363408.html","width":130,"caption":"Greenfinches","height":142});
															thumbnails[5524252] = clik.newPhoto({"id":5524252,"src":"judithcupwb_thumb.jpg","galleries_id":301649,"server_id":5,"link":"photo_5524252.html","width":130,"caption":"Judith Rowe","height":98});
															thumbnails[5582242] = clik.newPhoto({"id":5582242,"src":"musselweb_thumb.jpg","galleries_id":301647,"server_id":5,"link":"photo_5582242.html","width":130,"caption":"embroidery brooches","height":116});
															thumbnails[5582257] = clik.newPhoto({"id":5582257,"src":"Washedaway350web_thumb.jpg","galleries_id":316543,"server_id":5,"link":"photo_5582257.html","width":130,"caption":"Free Embroidery groyne","height":182});
															thumbnails[5989641] = clik.newPhoto({"id":5989641,"src":"dogweb_thumb.jpg","galleries_id":302492,"server_id":5,"link":"photo_5989641.html","width":130,"caption":"Anna Wilson Patterson","height":124});
															thumbnails[6984860] = clik.newPhoto({"id":6984860,"src":"websoap_thumb.jpg","galleries_id":301679,"server_id":5,"link":"photo_6984860.html","width":130,"caption":"our hand made soap","height":110});
															thumbnails[6984880] = clik.newPhoto({"id":6984880,"src":"webwood_thumb.jpg","galleries_id":301679,"server_id":5,"link":"photo_6984880.html","width":130,"caption":"wood","height":114});
															thumbnails[7795167] = clik.newPhoto({"id":7795167,"src":"Bittern_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_7795167.html","width":130,"caption":"Bittern","height":130});
															thumbnails[7795211] = clik.newPhoto({"id":7795211,"src":"Greenshanks_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_7795211.html","width":130,"caption":"Greenshanks","height":132});
															thumbnails[7795212] = clik.newPhoto({"id":7795212,"src":"Little_Terns_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_7795212.html","width":130,"caption":"Little Terns","height":131});
															thumbnails[7795217] = clik.newPhoto({"id":7795217,"src":"Eiders_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_7795217.html","width":130,"caption":"Eiders","height":293});
															thumbnails[7795218] = clik.newPhoto({"id":7795218,"src":"Oystercatchers_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_7795218.html","width":130,"caption":"Oystercatchers","height":295});
															thumbnails[7795322] = clik.newPhoto({"id":7795322,"src":"Waxwings_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_7795322.html","width":130,"caption":"Robert Greenhalf","height":132});
															thumbnails[8250139] = clik.newPhoto({"id":8250139,"src":"potterywb_thumb.jpg","galleries_id":301649,"server_id":5,"link":"photo_8250139.html","width":130,"caption":" Our range of hand made pottery","height":184});
															thumbnails[8502855] = clik.newPhoto({"id":8502855,"src":"stainedglasswb_thumb.jpg","galleries_id":316543,"server_id":5,"link":"photo_8502855.html","width":130,"caption":"Our new Stained Glass  (and boats by Stuart Chester)","height":99});
															thumbnails[8502877] = clik.newPhoto({"id":8502877,"src":"bottleswb_thumb.jpg","galleries_id":301649,"server_id":5,"link":"photo_8502877.html","width":130,"caption":"New Ceramics","height":126});
															thumbnails[8502879] = clik.newPhoto({"id":8502879,"src":"denyseacrylicwb_thumb.jpg","galleries_id":301647,"server_id":5,"link":"photo_8502879.html","width":130,"caption":"Funky Acrylic jewellery","height":121});
															thumbnails[8502882] = clik.newPhoto({"id":8502882,"src":"annredhutwb_thumb.jpg","galleries_id":302493,"server_id":5,"link":"photo_8502882.html","width":130,"caption":"New Oils by Anna Wilson Patterson","height":120});
															thumbnails[8503023] = clik.newPhoto({"id":8503023,"src":"merielfishwb_thumb.jpg","galleries_id":316543,"server_id":5,"link":"photo_8503023.html","width":130,"caption":"Driftwood paintings by Meriel Ensom","height":91});
															thumbnails[8503027] = clik.newPhoto({"id":8503027,"src":"virginia_rqb1_thumb.jpg","galleries_id":302493,"server_id":5,"link":"photo_8503027.html","width":130,"caption":"Oils by Virginnia Ridgley","height":130});
															thumbnails[8506478] = clik.newPhoto({"id":8506478,"src":"clairsoapwb_thumb.jpg","galleries_id":301679,"server_id":5,"link":"photo_8506478.html","width":130,"caption":"Handmade Goats Milk soap","height":130});
															thumbnails[5444005] = clik.newPhoto({"id":5444005,"src":"Redhutweb1_thumb.jpg","galleries_id":307053,"server_id":5,"link":"photo_5444005.html","width":130,"caption":"","height":131});
															thumbnails[5356450] = clik.newPhoto({"id":5356450,"src":"avocetfamilyweb_thumb.jpg","galleries_id":302493,"server_id":5,"link":"photo_5356450.html","width":130,"caption":"Avocet Family","height":96});
															thumbnails[5383892] = clik.newPhoto({"id":5383892,"src":"sunflowers_thumb.jpg","galleries_id":302491,"server_id":5,"link":"photo_5383892.html","width":130,"caption":"","height":128});
															thumbnails[5443919] = clik.newPhoto({"id":5443919,"src":"Redhutweb_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5443919.html","width":130,"caption":"The Red Hut<br>\r\nRye Harbour","height":131});
															thumbnails[5443998] = clik.newPhoto({"id":5443998,"src":"JaneBeechamweb_thumb.jpg","galleries_id":302492,"server_id":5,"link":"photo_5443998.html","width":130,"caption":"Jane Beecham","height":118});
															thumbnails[5444212] = clik.newPhoto({"id":5444212,"src":"judithcupweb_thumb.jpg","galleries_id":301649,"server_id":5,"link":"photo_5444212.html","width":130,"caption":" Judith Rowe","height":102});
															thumbnails[5451109] = clik.newPhoto({"id":5451109,"src":"ruthcloseupredweb_thumb.jpg","galleries_id":301647,"server_id":5,"link":"photo_5451109.html","width":130,"caption":"Leaves in Silver","height":123});
															thumbnails[5383881] = clik.newPhoto({"id":5383881,"src":"bluebellwood_thumb.jpg","galleries_id":302491,"server_id":5,"link":"photo_5383881.html","width":130,"caption":"Annie Soudain","height":131});
															thumbnails[5443906] = clik.newPhoto({"id":5443906,"src":"Companions_S1_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5443906.html","width":130,"caption":"Companions","height":137});
															thumbnails[5449729] = clik.newPhoto({"id":5449729,"src":"Megbagsweb_thumb.jpg","galleries_id":301650,"server_id":5,"link":"photo_5449729.html","width":130,"caption":"Felt ","height":106});
															thumbnails[5451111] = clik.newPhoto({"id":5451111,"src":"ruthbirdsweb_thumb.jpg","galleries_id":301647,"server_id":5,"link":"photo_5451111.html","width":130,"caption":"Birds and Nests","height":96});
															thumbnails[5383897] = clik.newPhoto({"id":5383897,"src":"yello_thumb.jpg","galleries_id":302491,"server_id":5,"link":"photo_5383897.html","width":130,"caption":"Annie Soudain","height":131});
															thumbnails[5363427] = clik.newPhoto({"id":5363427,"src":"Stems_in_Snow_S_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5363427.html","width":130,"caption":"Stems in Snow","height":137});
															thumbnails[5383895] = clik.newPhoto({"id":5383895,"src":"teazels_thumb.jpg","galleries_id":302491,"server_id":5,"link":"photo_5383895.html","width":130,"caption":"Annie Soudain","height":129});
															thumbnails[5451114] = clik.newPhoto({"id":5451114,"src":"ruthloopsweb_thumb.jpg","galleries_id":301647,"server_id":5,"link":"photo_5451114.html","width":130,"caption":"Organic Shapes","height":113});
															thumbnails[5524255] = clik.newPhoto({"id":5524255,"src":"judithbirdweb_thumb.jpg","galleries_id":301649,"server_id":5,"link":"photo_5524255.html","width":130,"caption":"Judith Rowe","height":98});
															thumbnails[5550661] = clik.newPhoto({"id":5550661,"src":"knitwearweb_thumb.jpg","galleries_id":301650,"server_id":5,"link":"photo_5550661.html","width":130,"caption":"Designer Knitwear","height":93});
															thumbnails[7787663] = clik.newPhoto({"id":7787663,"src":"Img13933_thumb.jpg","galleries_id":301609,"server_id":5,"link":"photo_7787663.html","width":130,"caption":"Matt Underwood","height":77});
															thumbnails[5356367] = clik.newPhoto({"id":5356367,"src":"Img6470_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5356367.html","width":130,"caption":"After the storm","height":131});
															thumbnails[5367030] = clik.newPhoto({"id":5367030,"src":"ruths_ringswb_thumb.jpg","galleries_id":301647,"server_id":5,"link":"photo_5367030.html","width":130,"caption":"Silver and gold rings by Ruth Praill","height":104});
															thumbnails[5443886] = clik.newPhoto({"id":5443886,"src":"camber_memories1_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5443886.html","width":130,"caption":"Camber Memories","height":108});
															thumbnails[5363420] = clik.newPhoto({"id":5363420,"src":"Img6472_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5363420.html","width":130,"caption":"Glastonbury Midwinter","height":108});
															thumbnails[5444210] = clik.newPhoto({"id":5444210,"src":"wendy_jungweb_thumb.jpg","galleries_id":301649,"server_id":5,"link":"photo_5444210.html","width":130,"caption":"Wendy Jung","height":111});
															thumbnails[5363422] = clik.newPhoto({"id":5363422,"src":"Img6476_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5363422.html","width":130,"caption":"Chalk Figure 1","height":100});
															thumbnails[5356420] = clik.newPhoto({"id":5356420,"src":"Img6475_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5356420.html","width":130,"caption":"Hog Trough Bottom","height":101});
															thumbnails[5363417] = clik.newPhoto({"id":5363417,"src":"field2_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5363417.html","width":130,"caption":"Twisted Field","height":62});
															thumbnails[5443852] = clik.newPhoto({"id":5443852,"src":"timeandtideweb_thumb.jpg","galleries_id":301608,"server_id":5,"link":"photo_5443852.html","width":130,"caption":"Time and Tide","height":86});
															thumbnails[8502876] = clik.newPhoto({"id":8502876,"src":"canalbankwb_thumb.jpg","galleries_id":449430,"server_id":5,"link":"photo_8502876.html","width":130,"caption":"New work by Annie Soudain","height":131});
															thumbnails[8502880] = clik.newPhoto({"id":8502880,"src":"jewlespcwb_thumb.jpg","galleries_id":449430,"server_id":5,"link":"photo_8502880.html","width":130,"caption":"New Jewellery","height":110});
															thumbnails[8506418] = clik.newPhoto({"id":8506418,"src":"Swanswb_thumb.jpg","galleries_id":449430,"server_id":5,"link":"photo_8506418.html","width":130,"caption":"New work by Robert Greenhalf","height":131});
															thumbnails[8506422] = clik.newPhoto({"id":8506422,"src":"chillwb_thumb.jpg","galleries_id":449430,"server_id":5,"link":"photo_8506422.html","width":130,"caption":"Annie Soudain","height":131});
															thumbnails[8761147] = clik.newPhoto({"id":8761147,"src":"woodwb_thumb.jpg","galleries_id":449430,"server_id":5,"link":"photo_8761147.html","width":130,"caption":"beautiful wood","height":122});
															thumbnails[8761149] = clik.newPhoto({"id":8761149,"src":"harewb_thumb.jpg","galleries_id":449430,"server_id":5,"link":"photo_8761149.html","width":130,"caption":"Hare and Moon","height":105});
															thumbnails[8761151] = clik.newPhoto({"id":8761151,"src":"bearswb_thumb.jpg","galleries_id":449430,"server_id":5,"link":"photo_8761151.html","width":130,"caption":"Hand knits and toys","height":134});
															thumbnails[8761154] = clik.newPhoto({"id":8761154,"src":"closeupringwb_thumb.jpg","galleries_id":449430,"server_id":5,"link":"photo_8761154.html","width":130,"caption":"Fabulous designer jewellery","height":123});
															thumbnails[8761156] = clik.newPhoto({"id":8761156,"src":"potterygroupwb_thumb.jpg","galleries_id":449430,"server_id":5,"link":"photo_8761156.html","width":130,"caption":"Lovely ceramics","height":122});
															thumbnails[5383522] = clik.newPhoto({"id":5383522,"src":"webhomepagesquare4_thumb.jpg","galleries_id":301651,"server_id":5,"link":"photo_5383522.html","width":130,"caption":"","height":92});
															thumbnails[5384199] = clik.newPhoto({"id":5384199,"src":"backgroundbeach1_thumb.jpg","galleries_id":301652,"server_id":5,"link":"photo_5384199.html","width":130,"caption":"","height":130});
															thumbnails[5482065] = clik.newPhoto({"id":5482065,"src":"menuweb_thumb.jpg","galleries_id":301651,"server_id":5,"link":"photo_5482065.html","width":130,"caption":"Menu Overview","height":92});
															thumbnails[5384715] = clik.newPhoto({"id":5384715,"src":"avocetwelcomepage1_thumb.jpg","galleries_id":301651,"server_id":5,"link":"photo_5384715.html","width":130,"caption":"Teas, Coffee and Drinks","height":96});
															thumbnails[5384725] = clik.newPhoto({"id":5384725,"src":"webcakes2_thumb.jpg","galleries_id":301651,"server_id":5,"link":"photo_5384725.html","width":130,"caption":"Cake","height":76});
															thumbnails[5384730] = clik.newPhoto({"id":5384730,"src":"webteas_thumb.jpg","galleries_id":301651,"server_id":5,"link":"photo_5384730.html","width":130,"caption":"Cream Teas","height":92});
															thumbnails[5384736] = clik.newPhoto({"id":5384736,"src":"weblunches_thumb.jpg","galleries_id":301651,"server_id":5,"link":"photo_5384736.html","width":130,"caption":"Lunches","height":92});
															thumbnails[5384752] = clik.newPhoto({"id":5384752,"src":"avocetwelcomepage5_thumb.jpg","galleries_id":301651,"server_id":5,"link":"photo_5384752.html","width":130,"caption":"Gifts","height":96});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[449430] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Christmas Show","link":"section540953.html","maxRecords":0.0,"photoIDs":[8502876.0,8502880.0,8506418.0,8506422.0,8761147.0,8761149.0,8761151.0,8761154.0,8761156.0],"skipIndex":0,"section_code":"section540953","featured_images":"8761156,8761154,8761151,8761149,8761147,8506422,8506418,8502880,8502876","id":449430,"singleSection":true});				  						galleries[307053] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Where We Are","link":"gallery_307053.html","maxRecords":0.0,"photoIDs":[5444005.0],"skipIndex":0,"section_code":"gallery","featured_images":5444005.0,"id":307053,"singleSection":false});				  						galleries[301651] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Our Menu","link":"section360910_301651.html","maxRecords":0.0,"photoIDs":[5383522.0,5482065.0,5384715.0,5384725.0,5384730.0,5384736.0,5384752.0],"skipIndex":0,"section_code":"section360910","featured_images":"5482065,5383522","id":301651,"singleSection":false});				  						galleries[301608] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photography","link":"gallery_301608.html","maxRecords":0.0,"photoIDs":[5443919.0,5443906.0,5363427.0,5356367.0,5443886.0,5363420.0,5363422.0,5356420.0,5363417.0,5443852.0],"skipIndex":0,"section_code":"gallery","featured_images":5356367.0,"id":301608,"singleSection":false});				  						galleries[302493] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Paintings","link":"gallery_302493.html","maxRecords":0.0,"photoIDs":[8502882.0,8503027.0,5356450.0],"skipIndex":0,"section_code":"gallery","featured_images":5356450.0,"id":302493,"singleSection":false});				  						galleries[302492] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Prints","link":"gallery_302492.html","maxRecords":0.0,"photoIDs":[5989641.0,5443998.0],"skipIndex":0,"section_code":"gallery","featured_images":"5989641,5443998","id":302492,"singleSection":false});				  						galleries[301609] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Woodcuts","link":"gallery_301609.html","maxRecords":0.0,"photoIDs":[5363384.0,5363394.0,5363408.0,7795167.0,7795211.0,7795212.0,7795217.0,7795218.0,7795322.0,7787663.0],"skipIndex":0,"section_code":"gallery","featured_images":"7795322,7795218,7795217,7795212,7795211,7795167,7787663,5363408,5363394,5363384","id":301609,"singleSection":false});				  						galleries[301649] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Ceramics","link":"gallery_301649.html","maxRecords":0.0,"photoIDs":[5524252.0,8250139.0,8502877.0,5444212.0,5524255.0,5444210.0],"skipIndex":0,"section_code":"gallery","featured_images":5444212.0,"id":301649,"singleSection":false});				  						galleries[301647] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Jewellery","link":"gallery_301647.html","maxRecords":0.0,"photoIDs":[5582242.0,8502879.0,5451109.0,5451111.0,5451114.0,5367030.0],"skipIndex":0,"section_code":"gallery","featured_images":5367030.0,"id":301647,"singleSection":false});				  						galleries[301650] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Crafts","link":"gallery_301650.html","maxRecords":0.0,"photoIDs":[5449729.0,5550661.0],"skipIndex":0,"section_code":"gallery","featured_images":"5550661,5449729","id":301650,"singleSection":false});				  						galleries[302491] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Linocuts","link":"gallery_302491.html","maxRecords":0.0,"photoIDs":[5383892.0,5383881.0,5383897.0,5383895.0],"skipIndex":0,"section_code":"gallery","featured_images":"5383897,5383895,5383892,5383881","id":302491,"singleSection":false});				  						galleries[316543] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"3D Work","link":"gallery_316543.html","maxRecords":0.0,"photoIDs":[5582257.0,8502855.0,8503023.0],"skipIndex":0,"section_code":"gallery","featured_images":"8503023,8502855,5582257","id":316543,"singleSection":false});				  						galleries[301679] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gifts","link":"gallery_301679.html","maxRecords":0.0,"photoIDs":[6984860.0,6984880.0,8506478.0],"skipIndex":0,"section_code":"gallery","featured_images":"8506478,6984880,6984860","id":301679,"singleSection":false});				  						galleries[301652] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Where We Are","link":"section360910_301652.html","maxRecords":0.0,"photoIDs":[5384199.0],"skipIndex":0,"section_code":"section360910","featured_images":5384199.0,"id":301652,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5383522';
imageSets[2] = '5482065,5383522,5444005,5444212,5356450,5367030,5356367';
imageSets[3] = '8761156,8761154,8761151,8761149,8761147,8506478,8506422,8506418,8503027,8503023,8502882,8502880,8502879,8502877,8502876,8502855,8250139,8250114,8250107,8215034,8215032,8215029,7795322,7795218,7795217,7795212,7795211,7795167,7787663,6984880,6984860,6487992,5989641,5791649,5791647,5582257,5582242,5550661,5524255,5524252,5482065,5451114,5451111,5451109,5449729,5444212,5444210,5444005,5443998,5443919';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Avocetgandt/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Avocetgandt/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 = 'Avocet Gallery & Tea Room: ' + 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;
	}
}

			

