window.thumbnails = {};
															thumbnails[5562221] = clik.newPhoto({"id":5562221,"src":"New_Fish_Quay_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_5562221.html","width":130,"caption":"Trawlers from New Fish Quay","height":86});
															thumbnails[2123600] = clik.newPhoto({"id":2123600,"src":"DSC_0062_edited-1JPG_thumb.jpg","galleries_id":141235,"server_id":1,"link":"photo_2123600.html","width":130,"caption":"Easterly Gale lashing Brixham Breakwater.","height":84});
															thumbnails[9051169] = clik.newPhoto({"id":9051169,"src":"Tq_thumb.jpg","galleries_id":477134,"server_id":1,"link":"photo_9051169.html","width":130,"caption":"Torquay with the harbour footbridge in the foreground","height":86});
															thumbnails[2123602] = clik.newPhoto({"id":2123602,"src":"DSC_0063_edited-1JPG_thumb.jpg","galleries_id":141235,"server_id":1,"link":"photo_2123602.html","width":130,"caption":"","height":85});
															thumbnails[9051179] = clik.newPhoto({"id":9051179,"src":"Tq_from_the_Harb_thumb.jpg","galleries_id":477134,"server_id":1,"link":"photo_9051179.html","width":130,"caption":"Torquay","height":86});
															thumbnails[2123603] = clik.newPhoto({"id":2123603,"src":"DSC_0064_edited-3JPG_thumb.jpg","galleries_id":141235,"server_id":1,"link":"photo_2123603.html","width":130,"caption":"","height":83});
															thumbnails[9051193] = clik.newPhoto({"id":9051193,"src":"Tq_Harb_thumb.jpg","galleries_id":477134,"server_id":1,"link":"photo_9051193.html","width":130,"caption":"Torquay Harbour","height":86});
															thumbnails[2123604] = clik.newPhoto({"id":2123604,"src":"DSC_0065_edited-1JPG_thumb.jpg","galleries_id":141235,"server_id":1,"link":"photo_2123604.html","width":130,"caption":"","height":85});
															thumbnails[9051195] = clik.newPhoto({"id":9051195,"src":"Tq_Harb__FB_thumb.jpg","galleries_id":477134,"server_id":1,"link":"photo_9051195.html","width":130,"caption":"Torquay Harbour & Footbridge","height":230});
															thumbnails[2123606] = clik.newPhoto({"id":2123606,"src":"DSC_0066_edited-1JPG_thumb.jpg","galleries_id":141235,"server_id":1,"link":"photo_2123606.html","width":130,"caption":"","height":85});
															thumbnails[2123608] = clik.newPhoto({"id":2123608,"src":"DSC_0067_edited-1JPG_thumb.jpg","galleries_id":141235,"server_id":1,"link":"photo_2123608.html","width":130,"caption":"","height":84});
															thumbnails[1257443] = clik.newPhoto({"id":1257443,"src":"DSC_0001JPG1_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1257443.html","width":130,"caption":"Inner Harbour, Brixham","height":86});
															thumbnails[1257706] = clik.newPhoto({"id":1257706,"src":"DSC_0017JPG2_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_1257706.html","width":130,"caption":"Froward Point","height":86});
															thumbnails[1257722] = clik.newPhoto({"id":1257722,"src":"DSC_0057_edited-1JPG1_thumb.jpg","galleries_id":41661,"server_id":1,"link":"photo_1257722.html","width":130,"caption":"Berry Head Lighthouse","height":86});
															thumbnails[1288746] = clik.newPhoto({"id":1288746,"src":"DSC_0091_edited-1JPG_thumb.jpg","galleries_id":38048,"server_id":1,"link":"photo_1288746.html","width":130,"caption":"Torbay Lifeboat","height":86});
															thumbnails[1583638] = clik.newPhoto({"id":1583638,"src":"DSC_0025JPG2_thumb.jpg","galleries_id":108203,"server_id":1,"link":"photo_1583638.html","width":130,"caption":"Dartmoor Pony","height":86});
															thumbnails[2123611] = clik.newPhoto({"id":2123611,"src":"DSC_0005_edited-2JPG_thumb.jpg","galleries_id":141235,"server_id":1,"link":"photo_2123611.html","width":130,"caption":"Rainbow over the Breakwater","height":84});
															thumbnails[5455880] = clik.newPhoto({"id":5455880,"src":"Broadsands_thumb.jpg","galleries_id":308341,"server_id":1,"link":"photo_5455880.html","width":130,"caption":"Broadsands","height":86});
															thumbnails[5516879] = clik.newPhoto({"id":5516879,"src":"Eiger_Monch__Jungfrau_thumb.jpg","galleries_id":310115,"server_id":1,"link":"photo_5516879.html","width":130,"caption":"Eiger, Monch & Jungfrau","height":86});
															thumbnails[5516884] = clik.newPhoto({"id":5516884,"src":"Kingswear_Castle_Straight_thumb.jpg","galleries_id":310113,"server_id":1,"link":"photo_5516884.html","width":130,"caption":"Kingswear Castle","height":86});
															thumbnails[1257490] = clik.newPhoto({"id":1257490,"src":"DSC_0047JPG_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1257490.html","width":130,"caption":"Trawlers","height":86});
															thumbnails[1257707] = clik.newPhoto({"id":1257707,"src":"DSC_0009JPG1_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_1257707.html","width":130,"caption":"Sharkham Point","height":86});
															thumbnails[1257725] = clik.newPhoto({"id":1257725,"src":"DSC_0064JPG_thumb.jpg","galleries_id":41661,"server_id":1,"link":"photo_1257725.html","width":130,"caption":"View South from Berry Head, Brixham","height":86});
															thumbnails[1583583] = clik.newPhoto({"id":1583583,"src":"DSC_0007JPG_thumb.jpg","galleries_id":38048,"server_id":1,"link":"photo_1583583.html","width":130,"caption":"Paignton and Dartmouth Steam Railway","height":86});
															thumbnails[1583644] = clik.newPhoto({"id":1583644,"src":"DSC_0026JPG_thumb.jpg","galleries_id":108203,"server_id":1,"link":"photo_1583644.html","width":130,"caption":"Dartmoor Pony","height":86});
															thumbnails[5455885] = clik.newPhoto({"id":5455885,"src":"Goodrington_thumb.jpg","galleries_id":308341,"server_id":1,"link":"photo_5455885.html","width":130,"caption":"Goodrington","height":85});
															thumbnails[5516868] = clik.newPhoto({"id":5516868,"src":"Jungfraujoch_thumb.jpg","galleries_id":310115,"server_id":1,"link":"photo_5516868.html","width":130,"caption":"Top of Europe","height":86});
															thumbnails[5516917] = clik.newPhoto({"id":5516917,"src":"Coleton_Fishacre_thumb.jpg","galleries_id":310113,"server_id":1,"link":"photo_5516917.html","width":130,"caption":"Coleton Fishacre","height":86});
															thumbnails[5562235] = clik.newPhoto({"id":5562235,"src":"South_from_Berry_Head_thumb.jpg","galleries_id":41661,"server_id":1,"link":"photo_5562235.html","width":130,"caption":"View south from Berry Head","height":84});
															thumbnails[1583594] = clik.newPhoto({"id":1583594,"src":"DSC_0007-1JPG_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1583594.html","width":130,"caption":"Trawlers at Fish Quay","height":86});
															thumbnails[5562215] = clik.newPhoto({"id":5562215,"src":"Day_is_Done_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_5562215.html","width":130,"caption":"Day Is Done","height":85});
															thumbnails[1257568] = clik.newPhoto({"id":1257568,"src":"DSC_0049JPG_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1257568.html","width":130,"caption":"Brixham's Inner Harbour","height":86});
															thumbnails[1257709] = clik.newPhoto({"id":1257709,"src":"DSC_0044_edited-1JPG2_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_1257709.html","width":130,"caption":"St Mary's Bay","height":86});
															thumbnails[1288749] = clik.newPhoto({"id":1288749,"src":"DSC_0057_edited-1-1JPG_thumb.jpg","galleries_id":41661,"server_id":1,"link":"photo_1288749.html","width":130,"caption":"Berry Head","height":86});
															thumbnails[1583587] = clik.newPhoto({"id":1583587,"src":"DSC_0030JPG1_thumb.jpg","galleries_id":38048,"server_id":1,"link":"photo_1583587.html","width":130,"caption":"Red Arrows","height":86});
															thumbnails[2020304] = clik.newPhoto({"id":2020304,"src":"DSC_0024_edited-2JPG_thumb.jpg","galleries_id":108203,"server_id":1,"link":"photo_2020304.html","width":130,"caption":"Cut-Throat Finch","height":96});
															thumbnails[5455888] = clik.newPhoto({"id":5455888,"src":"Oyster_Cove_thumb.jpg","galleries_id":308341,"server_id":1,"link":"photo_5455888.html","width":130,"caption":"Oyster Cove","height":86});
															thumbnails[5516844] = clik.newPhoto({"id":5516844,"src":"Aletsch_Glacier_thumb.jpg","galleries_id":310115,"server_id":1,"link":"photo_5516844.html","width":130,"caption":"Aletsch Glacier","height":86});
															thumbnails[8631430] = clik.newPhoto({"id":8631430,"src":"Over_the_Rooftops_2_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_8631430.html","width":130,"caption":"Over The Rooftops","height":86});
															thumbnails[8631444] = clik.newPhoto({"id":8631444,"src":"Berry_Head_from_Sharkham_printable_thumb.jpg","galleries_id":41661,"server_id":1,"link":"photo_8631444.html","width":130,"caption":"Berry Head from Sharkham","height":85});
															thumbnails[5562207] = clik.newPhoto({"id":5562207,"src":"Breakwater_Beach_lighter_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_5562207.html","width":130,"caption":"Breakwater Beach","height":85});
															thumbnails[1257621] = clik.newPhoto({"id":1257621,"src":"DSC_0025JPG_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1257621.html","width":130,"caption":"Low Tide","height":86});
															thumbnails[1257711] = clik.newPhoto({"id":1257711,"src":"DSC_0013_edited-1JPG2_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_1257711.html","width":130,"caption":"Sunset from Brixham Breakwater","height":84});
															thumbnails[1288751] = clik.newPhoto({"id":1288751,"src":"DSC_0052_edited-1JPG_thumb.jpg","galleries_id":41661,"server_id":1,"link":"photo_1288751.html","width":130,"caption":"Berry Head Fort 1","height":86});
															thumbnails[1708507] = clik.newPhoto({"id":1708507,"src":"DSC_0031_edited-1JPG_thumb.jpg","galleries_id":38048,"server_id":1,"link":"photo_1708507.html","width":130,"caption":"The Vigilance at Christmas","height":85});
															thumbnails[2020308] = clik.newPhoto({"id":2020308,"src":"DSC_0037_edited-1JPG_thumb.jpg","galleries_id":108203,"server_id":1,"link":"photo_2020308.html","width":130,"caption":"Red Panda","height":86});
															thumbnails[5455891] = clik.newPhoto({"id":5455891,"src":"Paignton_Harbour_straight_thumb.jpg","galleries_id":308341,"server_id":1,"link":"photo_5455891.html","width":130,"caption":"Paignton Harbour","height":85});
															thumbnails[5516882] = clik.newPhoto({"id":5516882,"src":"St_Beatus_Caves_thumb.jpg","galleries_id":310115,"server_id":1,"link":"photo_5516882.html","width":130,"caption":"St Beatus Caves","height":86});
															thumbnails[8631460] = clik.newPhoto({"id":8631460,"src":"Marina_Sunset_edited-1_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_8631460.html","width":130,"caption":"Sunset","height":86});
															thumbnails[8631510] = clik.newPhoto({"id":8631510,"src":"DSC_0570_edited-1_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_8631510.html","width":130,"caption":"Brixham Habour & New Fish Quay","height":85});
															thumbnails[8631514] = clik.newPhoto({"id":8631514,"src":"DSC_0571_edited-1_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_8631514.html","width":130,"caption":"Golden Hind & Old Market House","height":86});
															thumbnails[8631538] = clik.newPhoto({"id":8631538,"src":"DSC_0597_edited-1_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_8631538.html","width":130,"caption":"Brixham Inner Harbour","height":86});
															thumbnails[1257712] = clik.newPhoto({"id":1257712,"src":"DSC_0058_edited-2JPG1_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_1257712.html","width":130,"caption":"Golden Sunset","height":85});
															thumbnails[1288756] = clik.newPhoto({"id":1288756,"src":"DSC_0048_edited-1JPG_thumb.jpg","galleries_id":41661,"server_id":1,"link":"photo_1288756.html","width":130,"caption":"Berry Head Southern Fort","height":85});
															thumbnails[2020314] = clik.newPhoto({"id":2020314,"src":"DSC_0054_edited-1JPG_thumb.jpg","galleries_id":108203,"server_id":1,"link":"photo_2020314.html","width":130,"caption":"Golden Ringed Dragonfly","height":102});
															thumbnails[5455898] = clik.newPhoto({"id":5455898,"src":"Paignton_Harbour_2_thumb.jpg","galleries_id":308341,"server_id":1,"link":"photo_5455898.html","width":130,"caption":"Paignton Harbour","height":86});
															thumbnails[8631414] = clik.newPhoto({"id":8631414,"src":"DSC_0567_edited-1_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_8631414.html","width":130,"caption":"Golden Hind","height":86});
															thumbnails[8631437] = clik.newPhoto({"id":8631437,"src":"003_edited-1_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_8631437.html","width":130,"caption":"Snow in Brixham","height":82});
															thumbnails[1708505] = clik.newPhoto({"id":1708505,"src":"DSC_0027_edited-1JPG_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1708505.html","width":130,"caption":"Brixham Harbour at Christmas","height":85});
															thumbnails[8631440] = clik.newPhoto({"id":8631440,"src":"005_edited-1_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_8631440.html","width":130,"caption":"Snow in Brixham Harbour","height":85});
															thumbnails[2020306] = clik.newPhoto({"id":2020306,"src":"DSC_0034_edited-1JPG_1_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_2020306.html","width":130,"caption":"Battery Gardens, Brixham","height":86});
															thumbnails[1257680] = clik.newPhoto({"id":1257680,"src":"DSC_0034JPG1_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1257680.html","width":130,"caption":"Angling at Dusk","height":86});
															thumbnails[1257713] = clik.newPhoto({"id":1257713,"src":"DSC_0008JPG2_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_1257713.html","width":130,"caption":"Churston Point, Brixham","height":86});
															thumbnails[2020302] = clik.newPhoto({"id":2020302,"src":"DSC_0023_edited-1-1JPG_thumb.jpg","galleries_id":38048,"server_id":1,"link":"photo_2020302.html","width":130,"caption":"Brixham Marina","height":86});
															thumbnails[1583556] = clik.newPhoto({"id":1583556,"src":"DSC_0036JPG_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_1583556.html","width":130,"caption":"Berry Head, Brixham","height":86});
															thumbnails[1257684] = clik.newPhoto({"id":1257684,"src":"DSC_0030_edited-1JPG_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1257684.html","width":130,"caption":"Brixham at Sunset","height":86});
															thumbnails[1583553] = clik.newPhoto({"id":1583553,"src":"DSC_0034_edited-1JPG_thumb.jpg","galleries_id":38068,"server_id":1,"link":"photo_1583553.html","width":130,"caption":"Mansands","height":86});
															thumbnails[1257686] = clik.newPhoto({"id":1257686,"src":"DSC_0033_edited-1JPG_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1257686.html","width":130,"caption":"Harbour at Night","height":83});
															thumbnails[1288761] = clik.newPhoto({"id":1288761,"src":"DSC_0073_edited-1JPG_thumb.jpg","galleries_id":38049,"server_id":1,"link":"photo_1288761.html","width":130,"caption":"Harbour at Dusk","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[38049] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Brixham Harbour","link":"gallery_38049.html","maxRecords":0.0,"photoIDs":[5562221.0,1257443.0,1257490.0,1583594.0,5562215.0,1257568.0,8631430.0,1257621.0,8631460.0,8631510.0,8631514.0,8631538.0,8631414.0,8631437.0,1708505.0,8631440.0,1257680.0,1257684.0,1257686.0,1288761.0],"skipIndex":0,"section_code":"gallery","featured_images":"8631538,8631514,8631460,8631430,8631414,5562221,5562215","id":38049,"singleSection":false});				  						galleries[38048] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Planes, Trains and Boats","link":"gallery_38048.html","maxRecords":0.0,"photoIDs":[1288746.0,1583583.0,1583587.0,1708507.0,2020302.0],"skipIndex":0,"section_code":"gallery","featured_images":"2020302,1708507,1583587,1583583,1288746","id":38048,"singleSection":false});				  						galleries[38068] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Coast","link":"gallery_38068.html","maxRecords":0.0,"photoIDs":[1257706.0,1257707.0,1257709.0,5562207.0,1257711.0,1257712.0,2020306.0,1257713.0,1583556.0,1583553.0],"skipIndex":0,"section_code":"gallery","featured_images":"5562207,1257711","id":38068,"singleSection":false});				  						galleries[41661] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Berry Head National Nature Reserve","link":"gallery_41661.html","maxRecords":0.0,"photoIDs":[1257722.0,1257725.0,5562235.0,1288749.0,8631444.0,1288751.0,1288756.0],"skipIndex":0,"section_code":"gallery","featured_images":"5562235,1257725","id":41661,"singleSection":false});				  						galleries[141235] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Stormy Waters","link":"gallery_141235.html","maxRecords":0.0,"photoIDs":[2123600.0,2123602.0,2123603.0,2123604.0,2123606.0,2123608.0,2123611.0],"skipIndex":0,"section_code":"gallery","featured_images":"2123611,2123608,2123606,2123604,2123603,2123602,2123600","id":141235,"singleSection":false});				  						galleries[308341] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Paignton","link":"gallery_308341.html","maxRecords":0.0,"photoIDs":[5455880.0,5455885.0,5455888.0,5455891.0,5455898.0],"skipIndex":0,"section_code":"gallery","featured_images":"5455898,5455891,5455888,5455885,5455880","id":308341,"singleSection":false});				  						galleries[477134] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Torquay","link":"gallery_477134.html","maxRecords":0.0,"photoIDs":[9051169.0,9051179.0,9051193.0,9051195.0],"skipIndex":0,"section_code":"gallery","featured_images":"9051195,9051169","id":477134,"singleSection":false});				  						galleries[108203] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife","link":"gallery_108203.html","maxRecords":0.0,"photoIDs":[1583638.0,1583644.0,2020304.0,2020308.0,2020314.0],"skipIndex":0,"section_code":"gallery","featured_images":"2020314,2020308,2020304,1583644,1583638","id":108203,"singleSection":false});				  						galleries[310113] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Kingswear","link":"gallery_310113.html","maxRecords":0.0,"photoIDs":[5516884.0,5516917.0],"skipIndex":0,"section_code":"gallery","featured_images":5516884.0,"id":310113,"singleSection":false});				  						galleries[310115] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Switzerland","link":"gallery_310115.html","maxRecords":0.0,"photoIDs":[5516879.0,5516868.0,5516844.0,5516882.0],"skipIndex":0,"section_code":"gallery","featured_images":"5516882,5516879,5516868","id":310115,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9051169,9051193,8631430,5562207,1257711,8631460,8631514,8631538,8631414';
imageSets[2] = '5562221,9051169,9051195,5516884,5516879,5516868,1257725,5562235,5562215,8631430,5562207,5516882,1257711,8631460,8631514,8631538,8631414';
imageSets[3] = '8631430,8631460,8631514,8631538,8631414';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Simon_H/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Simon_H/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 = 'Images of the English Riviera: ' + 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;
	}
}

			

