window.thumbnails = {};
															thumbnails[5519375] = clik.newPhoto({"id":5519375,"src":"Tenby4725_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_5519375.html","width":130,"caption":"Tenby at sunset","height":87});
															thumbnails[5519378] = clik.newPhoto({"id":5519378,"src":"Tenby-dusk4743_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_5519378.html","width":130,"caption":"Tenby harbour at dusk.","height":86});
															thumbnails[5497720] = clik.newPhoto({"id":5497720,"src":"BarryIsland4700_thumb.jpg","galleries_id":102359,"server_id":1,"link":"photo_5497720.html","width":130,"caption":"Barry Island","height":60});
															thumbnails[2677186] = clik.newPhoto({"id":2677186,"src":"Maen-Llia3_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_2677186.html","width":130,"caption":"Maen Llia Standing Stone","height":86});
															thumbnails[3693120] = clik.newPhoto({"id":3693120,"src":"Maen-Llia1a_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_3693120.html","width":130,"caption":"Maen Llia standing stone","height":102});
															thumbnails[3693164] = clik.newPhoto({"id":3693164,"src":"PenarthPier2_thumb.jpg","galleries_id":102359,"server_id":1,"link":"photo_3693164.html","width":130,"caption":"Penarth Pier","height":102});
															thumbnails[3842999] = clik.newPhoto({"id":3842999,"src":"SD2_thumb.jpg","galleries_id":99850,"server_id":1,"link":"photo_3842999.html","width":130,"caption":"Dusk at Dunraven Bay","height":87});
															thumbnails[6646034] = clik.newPhoto({"id":6646034,"src":"Longships92bw_thumb.jpg","galleries_id":311204,"server_id":1,"link":"photo_6646034.html","width":130,"caption":"Longships Lighthouse","height":86});
															thumbnails[4875202] = clik.newPhoto({"id":4875202,"src":"Swan-3787_thumb.jpg","galleries_id":278155,"server_id":1,"link":"photo_4875202.html","width":130,"caption":"Mute Swan","height":86});
															thumbnails[4875108] = clik.newPhoto({"id":4875108,"src":"Dunraven-door3777_thumb.jpg","galleries_id":278149,"server_id":1,"link":"photo_4875108.html","width":130,"caption":"Dunraven Door","height":197});
															thumbnails[2676705] = clik.newPhoto({"id":2676705,"src":"Penarth-Pier-1_thumb.jpg","galleries_id":102359,"server_id":1,"link":"photo_2676705.html","width":130,"caption":"Penarth Pier","height":87});
															thumbnails[2674994] = clik.newPhoto({"id":2674994,"src":"Mumbles-Lighthouse-1_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_2674994.html","width":130,"caption":"Mumbles Lighthouse","height":86});
															thumbnails[2677017] = clik.newPhoto({"id":2677017,"src":"Penclawdd-2_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_2677017.html","width":130,"caption":"Boat in the mud","height":86});
															thumbnails[2683036] = clik.newPhoto({"id":2683036,"src":"Caerphilly-Castle-1_thumb.jpg","galleries_id":225612,"server_id":1,"link":"photo_2683036.html","width":130,"caption":"Caerphilly Castle","height":86});
															thumbnails[6645987] = clik.newPhoto({"id":6645987,"src":"Cornwall-Door4198_thumb.jpg","galleries_id":278149,"server_id":1,"link":"photo_6645987.html","width":130,"caption":"Old weathered door","height":181});
															thumbnails[6645424] = clik.newPhoto({"id":6645424,"src":"Caerphilly-Castle0354_thumb.jpg","galleries_id":225612,"server_id":1,"link":"photo_6645424.html","width":130,"caption":"Caerphilly Castle","height":94});
															thumbnails[5497754] = clik.newPhoto({"id":5497754,"src":"Godrevy4179_thumb.jpg","galleries_id":311204,"server_id":1,"link":"photo_5497754.html","width":130,"caption":"Godrevy Lighthouse","height":91});
															thumbnails[4875525] = clik.newPhoto({"id":4875525,"src":"Letter-box-39141_thumb.jpg","galleries_id":278149,"server_id":1,"link":"photo_4875525.html","width":130,"caption":"Victorian Post Box","height":181});
															thumbnails[3693101] = clik.newPhoto({"id":3693101,"src":"Usk-fog-2_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_3693101.html","width":130,"caption":"Foggy Winter Morning","height":87});
															thumbnails[1654971] = clik.newPhoto({"id":1654971,"src":"3C1p_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_1654971.html","width":130,"caption":"Three Cliffs Bay Sunset","height":80});
															thumbnails[6646252] = clik.newPhoto({"id":6646252,"src":"Puffin-5889_thumb.jpg","galleries_id":278155,"server_id":1,"link":"photo_6646252.html","width":130,"caption":"Puffin standing amongst sea campion","height":94});
															thumbnails[2676922] = clik.newPhoto({"id":2676922,"src":"Rhossili_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_2676922.html","width":130,"caption":"Rhossili Bay","height":86});
															thumbnails[8090652] = clik.newPhoto({"id":8090652,"src":"Puffin7482_thumb.jpg","galleries_id":278155,"server_id":1,"link":"photo_8090652.html","width":130,"caption":"Puffin with sandeels","height":94});
															thumbnails[5695818] = clik.newPhoto({"id":5695818,"src":"Little-owl-5074_thumb.jpg","galleries_id":278155,"server_id":1,"link":"photo_5695818.html","width":130,"caption":"Little Owl","height":172});
															thumbnails[5695838] = clik.newPhoto({"id":5695838,"src":"Barn-owl-4807_thumb.jpg","galleries_id":278155,"server_id":1,"link":"photo_5695838.html","width":130,"caption":"","height":181});
															thumbnails[2676796] = clik.newPhoto({"id":2676796,"src":"Nash-Point-HDR1_thumb.jpg","galleries_id":99850,"server_id":1,"link":"photo_2676796.html","width":130,"caption":"Nash Point","height":86});
															thumbnails[4875066] = clik.newPhoto({"id":4875066,"src":"Telephone-box-3891d_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_4875066.html","width":130,"caption":"Sanctuary in the Wilderness","height":86});
															thumbnails[2677155] = clik.newPhoto({"id":2677155,"src":"Millenium-Centre_thumb.jpg","galleries_id":169170,"server_id":1,"link":"photo_2677155.html","width":130,"caption":"The Millenium Centre","height":86});
															thumbnails[1449820] = clik.newPhoto({"id":1449820,"src":"Taf_Fechan_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_1449820.html","width":130,"caption":"Waterfall on the Taf Fechan","height":93});
															thumbnails[4874926] = clik.newPhoto({"id":4874926,"src":"Millenium-Centre-3751_thumb.jpg","galleries_id":169170,"server_id":1,"link":"photo_4874926.html","width":130,"caption":"Millenium Centre","height":86});
															thumbnails[3693129] = clik.newPhoto({"id":3693129,"src":"Taff-Fechan-winter_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_3693129.html","width":130,"caption":"Taf Fechan","height":86});
															thumbnails[6646577] = clik.newPhoto({"id":6646577,"src":"Blubells-vertical-5679_thumb.jpg","galleries_id":169427,"server_id":1,"link":"photo_6646577.html","width":130,"caption":"Bluebell Path","height":281});
															thumbnails[5497718] = clik.newPhoto({"id":5497718,"src":"Barry-boat-4643_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_5497718.html","width":130,"caption":"Old red boat","height":91});
															thumbnails[3693115] = clik.newPhoto({"id":3693115,"src":"Castell-Coch-snow_thumb.jpg","galleries_id":225612,"server_id":1,"link":"photo_3693115.html","width":130,"caption":"Castell Coch","height":165});
															thumbnails[2857714] = clik.newPhoto({"id":2857714,"src":"Llantwit-M-2064a_thumb.jpg","galleries_id":99850,"server_id":1,"link":"photo_2857714.html","width":130,"caption":"Pebbles at dawn I","height":86});
															thumbnails[1449088] = clik.newPhoto({"id":1449088,"src":"NB1_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_1449088.html","width":130,"caption":"Waterfall Nant Bwrefwr","height":87});
															thumbnails[8090239] = clik.newPhoto({"id":8090239,"src":"Aberthaw7586_thumb.jpg","galleries_id":99850,"server_id":1,"link":"photo_8090239.html","width":130,"caption":"Limpert Bay near Aberthaw","height":94});
															thumbnails[7215811] = clik.newPhoto({"id":7215811,"src":"Cickhowell-6579_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_7215811.html","width":130,"caption":"Bridge on the Usk, Crickhowell","height":91});
															thumbnails[8597337] = clik.newPhoto({"id":8597337,"src":"Road-to-nowhere8017_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_8597337.html","width":130,"caption":"The Road To Nowhere","height":91});
															thumbnails[8597347] = clik.newPhoto({"id":8597347,"src":"Monknash-5540-BW_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_8597347.html","width":130,"caption":"Dusk at Monknash","height":86});
															thumbnails[6646540] = clik.newPhoto({"id":6646540,"src":"TelBox6359_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_6646540.html","width":130,"caption":"Sanctuary in the Wilderness II","height":185});
															thumbnails[6646591] = clik.newPhoto({"id":6646591,"src":"Bluebells-wood-5776_thumb.jpg","galleries_id":169427,"server_id":1,"link":"photo_6646591.html","width":130,"caption":"Bluebell wood","height":60});
															thumbnails[4875177] = clik.newPhoto({"id":4875177,"src":"Pebbles-3383_thumb.jpg","galleries_id":278149,"server_id":1,"link":"photo_4875177.html","width":130,"caption":"Pebbles","height":86});
															thumbnails[2676856] = clik.newPhoto({"id":2676856,"src":"Whiteford-night-3_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_2676856.html","width":130,"caption":"Whiteford Point Lighthouse","height":196});
															thumbnails[7215881] = clik.newPhoto({"id":7215881,"src":"Cwm-Crew6775_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_7215881.html","width":130,"caption":"Cwm Crew Hawthorn","height":185});
															thumbnails[8597341] = clik.newPhoto({"id":8597341,"src":"Fan-Nedd-stileBW_thumb.jpg","galleries_id":169168,"server_id":1,"link":"photo_8597341.html","width":130,"caption":"Fan Nedd Stile","height":279});
															thumbnails[6646096] = clik.newPhoto({"id":6646096,"src":"St-Ives-detail-6139_thumb.jpg","galleries_id":311204,"server_id":1,"link":"photo_6646096.html","width":130,"caption":"Fishing boat detail","height":94});
															thumbnails[6645611] = clik.newPhoto({"id":6645611,"src":"Marloes-5813_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_6645611.html","width":130,"caption":"Marloes Sunset","height":91});
															thumbnails[2682862] = clik.newPhoto({"id":2682862,"src":"Conifers_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_2682862.html","width":130,"caption":"Conifer plantation","height":87});
															thumbnails[6646603] = clik.newPhoto({"id":6646603,"src":"SYE6224_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_6646603.html","width":130,"caption":"Sgwd Yr Eira","height":91});
															thumbnails[7216666] = clik.newPhoto({"id":7216666,"src":"SICG6616_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_7216666.html","width":130,"caption":"Sgwd Isaf Clun Gwyn","height":91});
															thumbnails[8090508] = clik.newPhoto({"id":8090508,"src":"Sgwd-Gwladys-7458_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_8090508.html","width":130,"caption":"Sgwd Gwladys","height":94});
															thumbnails[8090518] = clik.newPhoto({"id":8090518,"src":"Llywn-onn7162_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_8090518.html","width":130,"caption":"Llwyn-onn Reflections","height":94});
															thumbnails[7216368] = clik.newPhoto({"id":7216368,"src":"Saddle-Tor-6716a_thumb.jpg","galleries_id":311204,"server_id":1,"link":"photo_7216368.html","width":130,"caption":"Saddle Tor Sunset","height":66});
															thumbnails[6646402] = clik.newPhoto({"id":6646402,"src":"Mumbles-Lighthouse-5349_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_6646402.html","width":130,"caption":"Mumbles Lighthouse and Bracelet Bay","height":94});
															thumbnails[2683197] = clik.newPhoto({"id":2683197,"src":"Camlais-pool_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_2683197.html","width":130,"caption":"Camlais Pool","height":51});
															thumbnails[7215901] = clik.newPhoto({"id":7215901,"src":"Llangennith-6978_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_7215901.html","width":130,"caption":"Worms Head and Llangennith Burrows","height":91});
															thumbnails[5497714] = clik.newPhoto({"id":5497714,"src":"Beacons-winter-pano_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_5497714.html","width":130,"caption":"Brecon Beacons wniter panorama","height":59});
															thumbnails[7216355] = clik.newPhoto({"id":7216355,"src":"Owl-eagle-5225_thumb.jpg","galleries_id":278155,"server_id":1,"link":"photo_7216355.html","width":130,"caption":"Eagle Owl","height":94});
															thumbnails[1654645] = clik.newPhoto({"id":1654645,"src":"LlantwitM3-10x8_thumb.jpg","galleries_id":99850,"server_id":1,"link":"photo_1654645.html","width":130,"caption":"Stout Point from Llantwit Major beach.","height":165});
															thumbnails[4875572] = clik.newPhoto({"id":4875572,"src":"Worms-Head-dusk3974_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_4875572.html","width":130,"caption":"Worms Head","height":60});
															thumbnails[2857717] = clik.newPhoto({"id":2857717,"src":"Llantwit-M-2071_thumb.jpg","galleries_id":99850,"server_id":1,"link":"photo_2857717.html","width":130,"caption":"Pebbles at dawn II","height":196});
															thumbnails[2683071] = clik.newPhoto({"id":2683071,"src":"Henrhyd-3_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_2683071.html","width":130,"caption":"Henrhyd Falls","height":192});
															thumbnails[2857729] = clik.newPhoto({"id":2857729,"src":"Southerndown1939_thumb.jpg","galleries_id":99850,"server_id":1,"link":"photo_2857729.html","width":130,"caption":"Dunraven sunset","height":196});
															thumbnails[8597600] = clik.newPhoto({"id":8597600,"src":"Porthcawl8069_thumb.jpg","galleries_id":99850,"server_id":1,"link":"photo_8597600.html","width":130,"caption":"Dusk at Porthcawl","height":181});
															thumbnails[3693150] = clik.newPhoto({"id":3693150,"src":"Worms-Head3_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_3693150.html","width":130,"caption":"Worms Head","height":53});
															thumbnails[8597554] = clik.newPhoto({"id":8597554,"src":"Penclawdd-sunsetHDR_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_8597554.html","width":130,"caption":"Fire clouds","height":60});
															thumbnails[8090585] = clik.newPhoto({"id":8090585,"src":"Strumble-Head-night7291_thumb.jpg","galleries_id":101651,"server_id":1,"link":"photo_8090585.html","width":130,"caption":"Strumble Head at Night","height":60});
															thumbnails[5497741] = clik.newPhoto({"id":5497741,"src":"Sgwd-Ddwli-4018_thumb.jpg","galleries_id":100129,"server_id":1,"link":"photo_5497741.html","width":130,"caption":"Sgwd Ddwli","height":181});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[169427] = clik.newGallery({"parentGallery":100127,"usePopups":false,"title":"Various landscapes","link":"gallery_169427.html","maxRecords":0.0,"photoIDs":[6646577.0,6646591.0],"skipIndex":0,"section_code":"gallery","featured_images":"6646591,6646577","id":169427,"singleSection":false});				  						galleries[100129] = clik.newGallery({"parentGallery":100127,"usePopups":false,"title":"Brecon Beacons","link":"gallery_100129.html","maxRecords":0.0,"photoIDs":[2677186.0,3693120.0,1449820.0,3693129.0,1449088.0,2682862.0,6646603.0,7216666.0,8090508.0,8090518.0,2683197.0,5497714.0,2683071.0,5497741.0],"skipIndex":0,"section_code":"gallery","featured_images":"7216666,2677186","id":100129,"singleSection":false});				  						galleries[99850] = clik.newGallery({"parentGallery":100121,"usePopups":false,"title":"Glamorgan Heritage Coast","link":"gallery_99850.html","maxRecords":0.0,"photoIDs":[3842999.0,2676796.0,2857714.0,8090239.0,1654645.0,2857717.0,2857729.0,8597600.0],"skipIndex":0,"section_code":"gallery","featured_images":"8597600,2857714,2676796","id":99850,"singleSection":false});				  						galleries[100127] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_100127.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"7216666,2677186","id":100127,"singleSection":false});				  						galleries[101651] = clik.newGallery({"parentGallery":100121,"usePopups":false,"title":"Gower and West Wales","link":"gallery_101651.html","maxRecords":0.0,"photoIDs":[5519375.0,5519378.0,2674994.0,1654971.0,2676922.0,2676856.0,6645611.0,6646402.0,7215901.0,4875572.0,3693150.0,8597554.0,8090585.0],"skipIndex":0,"section_code":"gallery","featured_images":"8597554,8090585,7215901,6645611,5519378,5519375,4875572,2676922,2674994,1654971","id":101651,"singleSection":false});				  						galleries[100121] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Seascapes","link":"gallery_100121.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"8597600,8597554,8090585,7215901,6645611,5519378,5519375,4875572,3693164,2857714,2676922,2676796,2676705,2674994,1654971","id":100121,"singleSection":false});				  						galleries[169168] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Black and White and Spot Colour","link":"gallery_169168.html","maxRecords":0.0,"photoIDs":[2677017.0,3693101.0,4875066.0,5497718.0,7215811.0,8597337.0,8597347.0,6646540.0,7215881.0,8597341.0],"skipIndex":0,"section_code":"gallery","featured_images":"8597347,8597337,7215881,5497718,4875066,2677017","id":169168,"singleSection":false});				  						galleries[102359] = clik.newGallery({"parentGallery":100121,"usePopups":false,"title":"Various","link":"gallery_102359.html","maxRecords":0.0,"photoIDs":[5497720.0,3693164.0,2676705.0],"skipIndex":0,"section_code":"gallery","featured_images":"3693164,2676705","id":102359,"singleSection":false});				  						galleries[169170] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cardiff","link":"gallery_169170.html","maxRecords":0.0,"photoIDs":[2677155.0,4874926.0],"skipIndex":0,"section_code":"gallery","featured_images":"4874926,2677155","id":169170,"singleSection":false});				  						galleries[225612] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Castles","link":"gallery_225612.html","maxRecords":0.0,"photoIDs":[2683036.0,6645424.0,3693115.0],"skipIndex":0,"section_code":"gallery","featured_images":"6645424,3693115,2683036","id":225612,"singleSection":false});				  						galleries[278149] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Miscellaneous","link":"gallery_278149.html","maxRecords":0.0,"photoIDs":[4875108.0,6645987.0,4875525.0,4875177.0],"skipIndex":0,"section_code":"gallery","featured_images":4875177.0,"id":278149,"singleSection":false});				  						galleries[278155] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Nature","link":"gallery_278155.html","maxRecords":0.0,"photoIDs":[4875202.0,6646252.0,8090652.0,5695818.0,5695838.0,7216355.0],"skipIndex":0,"section_code":"gallery","featured_images":"8090652,7216355,6646252,4875202","id":278155,"singleSection":false});				  						galleries[311204] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Devon & Cornwall","link":"gallery_311204.html","maxRecords":0.0,"photoIDs":[6646034.0,5497754.0,6646096.0,7216368.0],"skipIndex":0,"section_code":"gallery","featured_images":"7216368,6646034,5497754","id":311204,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5519378,5519375,2677186,6646034,2676705,2674994,5497754,1654971,6646252,2676922,8090652,4875066,4874926,5497718,8597337,8597347,7215881,6645611,7216666,7216368,7215901,4875572,8597554,8090585';
imageSets[2] = '5519378,5519375,3693164,2677186,6646034,4875202,2677017,2676705,2674994,5497754,1654971,6646252,2676922,8090652,2676796,4875066,2677155,4874926,5497718,2857714,8597337,8597347,4875177,7215881,6645611,7216666,7216368,7215901,7216355,4875572,8597600,8597554,8090585';
imageSets[3] = '8597600,8597554,8597347,8597341,8597337,8090652,8090585,8090518,8090508,8090239,7216666,7216368,7216355,7215901,7215881,7215811,6646603,6646591,6646577,6646540,6646402,6646252,6646096,6646034,6645987,6645611,6645424,5695838,5695818,5519378,5519375,5497754,5497741,5497720,5497718,5497714,4875572,4875525,4875202,4875177,4875108,4875066,4874926,3842999,3693164,3693150,3693129,3693120,3693115,3693101';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/lewismd/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/lewismd/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/lewismd/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/lewismd/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/lewismd/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/lewismd/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/lewismd/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/lewismd/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 = 'Tir A Môr Photography: ' + 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;
	}
}

			

