window.thumbnails = {};
															thumbnails[6626576] = clik.newPhoto({"id":6626576,"src":"Lighthouse_2_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626576.html","width":130,"caption":"From the foot of Southwold Lighthouse","height":195});
															thumbnails[6625924] = clik.newPhoto({"id":6625924,"src":"Aldeburgh_Boat_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6625924.html","width":130,"caption":"Fishing Boats","height":87});
															thumbnails[6625927] = clik.newPhoto({"id":6625927,"src":"Aldeburgh_fish_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6625927.html","width":130,"caption":"Fish for sale","height":87});
															thumbnails[6625929] = clik.newPhoto({"id":6625929,"src":"Aldeburgh_lookout_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6625929.html","width":130,"caption":"Lookout","height":87});
															thumbnails[6626532] = clik.newPhoto({"id":6626532,"src":"Common_10_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_6626532.html","width":130,"caption":"Summer colours","height":195});
															thumbnails[6626593] = clik.newPhoto({"id":6626593,"src":"Southwold_Harbour_4_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626593.html","width":130,"caption":"Southwold Harbour","height":87});
															thumbnails[6626585] = clik.newPhoto({"id":6626585,"src":"Southwold_Dawn_2_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626585.html","width":130,"caption":"Early at the Pier","height":87});
															thumbnails[6626591] = clik.newPhoto({"id":6626591,"src":"Southwold_Dawn_7_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626591.html","width":130,"caption":"First light","height":82});
															thumbnails[6626583] = clik.newPhoto({"id":6626583,"src":"Seafront_3_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626583.html","width":130,"caption":"Evening Stroll","height":87});
															thumbnails[6625908] = clik.newPhoto({"id":6625908,"src":"Aldeburgh_1_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6625908.html","width":130,"caption":"A working Beach","height":87});
															thumbnails[6625912] = clik.newPhoto({"id":6625912,"src":"Aldeburgh_2_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6625912.html","width":130,"caption":"Aldeburgh","height":87});
															thumbnails[6625917] = clik.newPhoto({"id":6625917,"src":"Aldeburgh_3_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6625917.html","width":130,"caption":"Aldeburgh beach","height":87});
															thumbnails[6625918] = clik.newPhoto({"id":6625918,"src":"Aldeburgh_4_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6625918.html","width":130,"caption":"Sea blue","height":87});
															thumbnails[6625922] = clik.newPhoto({"id":6625922,"src":"Aldeburgh_5_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6625922.html","width":130,"caption":"Pebbles","height":87});
															thumbnails[6625931] = clik.newPhoto({"id":6625931,"src":"Aldeburgh_Shell_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6625931.html","width":130,"caption":"Aldeburgh shell","height":87});
															thumbnails[6626578] = clik.newPhoto({"id":6626578,"src":"Blyth_Sunset_2_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626578.html","width":130,"caption":"Sunset over the River Blyth","height":195});
															thumbnails[6626581] = clik.newPhoto({"id":6626581,"src":"Blyth_Sunset_3_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626581.html","width":130,"caption":"River Blyth","height":87});
															thumbnails[6626596] = clik.newPhoto({"id":6626596,"src":"Southwold_Harbour_10_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626596.html","width":130,"caption":"Sunset at Southwold Harbour","height":87});
															thumbnails[6626597] = clik.newPhoto({"id":6626597,"src":"Southwold_Harbour_11_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626597.html","width":130,"caption":"Harbour jetty","height":195});
															thumbnails[6626599] = clik.newPhoto({"id":6626599,"src":"Southwold_Harbour_12_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626599.html","width":130,"caption":"Done for the day","height":87});
															thumbnails[6626602] = clik.newPhoto({"id":6626602,"src":"Southwold_Harbour_13_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_6626602.html","width":130,"caption":"Earlier at the Harbour","height":87});
															thumbnails[6626565] = clik.newPhoto({"id":6626565,"src":"Common_9_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_6626565.html","width":130,"caption":"Silver birch","height":87});
															thumbnails[4920947] = clik.newPhoto({"id":4920947,"src":"Pier_end_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920947.html","width":130,"caption":"The end of the pier","height":195});
															thumbnails[4920948] = clik.newPhoto({"id":4920948,"src":"sole_bay_inn_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920948.html","width":130,"caption":"The Sole Bay Inn","height":71});
															thumbnails[4989865] = clik.newPhoto({"id":4989865,"src":"Pier_legs_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4989865.html","width":130,"caption":"The Legs of Southwold Pier","height":60});
															thumbnails[4920985] = clik.newPhoto({"id":4920985,"src":"Reydon_corn_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920985.html","width":130,"caption":"Fields of corn in August, just on the edge of Reydon","height":87});
															thumbnails[4843089] = clik.newPhoto({"id":4843089,"src":"Covehithebeach_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4843089.html","width":130,"caption":"Covehithe beach","height":85});
															thumbnails[4920973] = clik.newPhoto({"id":4920973,"src":"tankers_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920973.html","width":130,"caption":"Land and Sea","height":87});
															thumbnails[4920978] = clik.newPhoto({"id":4920978,"src":"EastonHomeCovert_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920978.html","width":130,"caption":"Easton Home Covert","height":75});
															thumbnails[4920981] = clik.newPhoto({"id":4920981,"src":"Covehithe_Panorama_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920981.html","width":130,"caption":"Covehithe panorama","height":52});
															thumbnails[4920983] = clik.newPhoto({"id":4920983,"src":"Covehithe_church_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920983.html","width":130,"caption":"Covehithe Church","height":86});
															thumbnails[4842792] = clik.newPhoto({"id":4842792,"src":"Blyth_panorama_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4842792.html","width":130,"caption":"River Blyth near Southwold","height":53});
															thumbnails[4842812] = clik.newPhoto({"id":4842812,"src":"Walberswick_hut_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4842812.html","width":130,"caption":"Walberswick hut","height":93});
															thumbnails[4842788] = clik.newPhoto({"id":4842788,"src":"Beach_huts_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4842788.html","width":130,"caption":"Beach Huts","height":93});
															thumbnails[4842810] = clik.newPhoto({"id":4842810,"src":"Southwold_Panorama_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4842810.html","width":130,"caption":"Southwold seafront","height":53});
															thumbnails[4843090] = clik.newPhoto({"id":4843090,"src":"Lighthouse_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4843090.html","width":130,"caption":"Southwold Lighthouse","height":188});
															thumbnails[4920969] = clik.newPhoto({"id":4920969,"src":"pier5_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920969.html","width":130,"caption":"Southwold from the pier","height":195});
															thumbnails[6625935] = clik.newPhoto({"id":6625935,"src":"BatterseaPS_1_thumb.jpg","galleries_id":362963,"server_id":5,"link":"photo_6625935.html","width":130,"caption":"Battersea Power Station","height":87});
															thumbnails[6626566] = clik.newPhoto({"id":6626566,"src":"Common_Snow_2_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_6626566.html","width":130,"caption":"Common under Snow","height":195});
															thumbnails[4920976] = clik.newPhoto({"id":4920976,"src":"RoughWalks_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920976.html","width":130,"caption":"Rough Walk","height":86});
															thumbnails[4842830] = clik.newPhoto({"id":4842830,"src":"WindmillonReydonMarsh1_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4842830.html","width":130,"caption":"Windpump on Reydon Marsh","height":195});
															thumbnails[4920963] = clik.newPhoto({"id":4920963,"src":"BlythPan2_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920963.html","width":130,"caption":"Blyth panorama","height":50});
															thumbnails[2998864] = clik.newPhoto({"id":2998864,"src":"waves_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_2998864.html","width":130,"caption":"North Sea Waves","height":83});
															thumbnails[4842804] = clik.newPhoto({"id":4842804,"src":"Pier_mono_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4842804.html","width":130,"caption":"The Approaching Storm - mono","height":93});
															thumbnails[4842807] = clik.newPhoto({"id":4842807,"src":"Pier_sunrise_2_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4842807.html","width":130,"caption":"The pier at dawn","height":93});
															thumbnails[6625940] = clik.newPhoto({"id":6625940,"src":"CardiffBay1_thumb.jpg","galleries_id":362963,"server_id":5,"link":"photo_6625940.html","width":130,"caption":"Cardiff Bay","height":78});
															thumbnails[6625942] = clik.newPhoto({"id":6625942,"src":"CardiffBay2_thumb.jpg","galleries_id":362963,"server_id":5,"link":"photo_6625942.html","width":130,"caption":"Cardiff Bay Barrage","height":87});
															thumbnails[6626518] = clik.newPhoto({"id":6626518,"src":"CardiffMilleniumBW_thumb.jpg","galleries_id":362963,"server_id":5,"link":"photo_6626518.html","width":130,"caption":"Cardiff Millennium Centre","height":86});
															thumbnails[4920962] = clik.newPhoto({"id":4920962,"src":"LordNelson_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920962.html","width":130,"caption":"The Lord Nelson","height":103});
															thumbnails[6626529] = clik.newPhoto({"id":6626529,"src":"Snape_Maltings_thumb.jpg","galleries_id":362956,"server_id":5,"link":"photo_6626529.html","width":130,"caption":"Snape Maltings","height":87});
															thumbnails[4920957] = clik.newPhoto({"id":4920957,"src":"StJames_Green_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920957.html","width":130,"caption":"St James Green and the lighthouse","height":81});
															thumbnails[4920960] = clik.newPhoto({"id":4920960,"src":"StEdmunds_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4920960.html","width":130,"caption":"St Edmund's Church","height":81});
															thumbnails[4842790] = clik.newPhoto({"id":4842790,"src":"Blyth_harbour_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4842790.html","width":130,"caption":"Blyth Estuary","height":93});
															thumbnails[4842794] = clik.newPhoto({"id":4842794,"src":"Harbour_nets_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_4842794.html","width":130,"caption":"Southwold Harbour","height":93});
															thumbnails[3194513] = clik.newPhoto({"id":3194513,"src":"PebbleonaBeach_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_3194513.html","width":130,"caption":"Pebble on a Beach","height":87});
															thumbnails[3194524] = clik.newPhoto({"id":3194524,"src":"SouthwoldBeach_thumb.jpg","galleries_id":276496,"server_id":5,"link":"photo_3194524.html","width":130,"caption":"Southwold Beach at Sunrise","height":87});
															thumbnails[6625950] = clik.newPhoto({"id":6625950,"src":"WellsCathedral_thumb.jpg","galleries_id":362963,"server_id":5,"link":"photo_6625950.html","width":130,"caption":"Wells Cathedral","height":82});
															thumbnails[5497748] = clik.newPhoto({"id":5497748,"src":"IMG_0224_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5497748.html","width":130,"caption":"Fallen trees and frosted grass","height":87});
															thumbnails[5515666] = clik.newPhoto({"id":5515666,"src":"IMG_0256_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5515666.html","width":130,"caption":"The White Guardians","height":87});
															thumbnails[5515718] = clik.newPhoto({"id":5515718,"src":"IMG_2890_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5515718.html","width":130,"caption":"Regeneration","height":195});
															thumbnails[5515667] = clik.newPhoto({"id":5515667,"src":"IMG_0454_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5515667.html","width":130,"caption":"Pillar of Snow","height":195});
															thumbnails[2880153] = clik.newPhoto({"id":2880153,"src":"DeeronAshteadCommon_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_2880153.html","width":130,"caption":"Deer on Ashtead Common","height":91});
															thumbnails[5515685] = clik.newPhoto({"id":5515685,"src":"IMG_1282_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5515685.html","width":130,"caption":"Spring","height":195});
															thumbnails[5515692] = clik.newPhoto({"id":5515692,"src":"IMG_1325_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5515692.html","width":130,"caption":"My oak","height":195});
															thumbnails[2880155] = clik.newPhoto({"id":2880155,"src":"DeeronAshteadCommon2_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_2880155.html","width":130,"caption":"Deer alert","height":171});
															thumbnails[5497739] = clik.newPhoto({"id":5497739,"src":"Common_Panorama2_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5497739.html","width":130,"caption":"Common panorama 1","height":61});
															thumbnails[5497744] = clik.newPhoto({"id":5497744,"src":"Common_Panorama4_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5497744.html","width":130,"caption":"Common panorama 2","height":57});
															thumbnails[5497746] = clik.newPhoto({"id":5497746,"src":"CommonTree_Panorama1_BW_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5497746.html","width":130,"caption":"The Sentry","height":316});
															thumbnails[2868274] = clik.newPhoto({"id":2868274,"src":"AshteadCommonMeadow_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_2868274.html","width":130,"caption":"Ashtead Common Meadow","height":87});
															thumbnails[3194481] = clik.newPhoto({"id":3194481,"src":"Fern_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_3194481.html","width":130,"caption":"Fern","height":195});
															thumbnails[5515719] = clik.newPhoto({"id":5515719,"src":"IMG_4128_edited-1_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5515719.html","width":130,"caption":"Summer Meadow","height":87});
															thumbnails[5515723] = clik.newPhoto({"id":5515723,"src":"IMG_4281_edited1And2More_tonemapped_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5515723.html","width":130,"caption":"Evening Meadow","height":87});
															thumbnails[2868652] = clik.newPhoto({"id":2868652,"src":"AshteadCommonOaks_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_2868652.html","width":130,"caption":"Ancient Oaks on Ashtead Common","height":86});
															thumbnails[5515733] = clik.newPhoto({"id":5515733,"src":"IMG_5031_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5515733.html","width":130,"caption":"Autumn stroll","height":195});
															thumbnails[3178411] = clik.newPhoto({"id":3178411,"src":"AshteadCommonMorning2_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_3178411.html","width":130,"caption":"Autumn Morning","height":87});
															thumbnails[5515713] = clik.newPhoto({"id":5515713,"src":"IMG_2438_thumb.jpg","galleries_id":311172,"server_id":5,"link":"photo_5515713.html","width":130,"caption":"Fallen Tree","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[276496] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Southwold","link":"gallery_276496.html","maxRecords":0.0,"photoIDs":[6626576.0,6626593.0,6626585.0,6626591.0,6626583.0,6626578.0,6626581.0,6626596.0,6626597.0,6626599.0,6626602.0,4920947.0,4920948.0,4989865.0,4920985.0,4843089.0,4920973.0,4920978.0,4920981.0,4920983.0,4842792.0,4842812.0,4842788.0,4842810.0,4843090.0,4920969.0,4920976.0,4842830.0,4920963.0,2998864.0,4842804.0,4842807.0,4920962.0,4920957.0,4920960.0,4842790.0,4842794.0,3194513.0,3194524.0],"skipIndex":0,"section_code":"gallery","featured_images":"6626602,6626599,6626597,6626596,6626593,6626591,6626585,6626583,6626581,6626578","id":276496,"singleSection":false});				  						galleries[362956] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Aldeburgh and Snape","link":"gallery_362956.html","maxRecords":0.0,"photoIDs":[6625924.0,6625927.0,6625929.0,6625908.0,6625912.0,6625917.0,6625918.0,6625922.0,6625931.0,6626529.0],"skipIndex":0,"section_code":"gallery","featured_images":"6626529,6625931,6625929,6625927,6625924,6625922,6625918,6625917,6625912,6625908","id":362956,"singleSection":false});				  						galleries[311172] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Ashtead Common","link":"gallery_311172.html","maxRecords":0.0,"photoIDs":[6626532.0,6626565.0,6626566.0,5497748.0,5515666.0,5515718.0,5515667.0,2880153.0,5515685.0,5515692.0,2880155.0,5497739.0,5497744.0,5497746.0,2868274.0,3194481.0,5515719.0,5515723.0,2868652.0,5515733.0,3178411.0,5515713.0],"skipIndex":0,"section_code":"gallery","featured_images":"6626566,6626565,6626532,5515733,5515723,5515719,5515718,5515713,5515692,5515685","id":311172,"singleSection":false});				  						galleries[362963] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Urban UK","link":"gallery_362963.html","maxRecords":0.0,"photoIDs":[6625935.0,6625940.0,6625942.0,6626518.0,6625950.0],"skipIndex":0,"section_code":"gallery","featured_images":"6626518,6625950,6625942,6625940,6625935","id":362963,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6626602,6626599,6626597,6626596,6626593,6626591,6626585,6626583,6626581,6626578,6626576,6626565,6626532,6626529,6626518,6625950,6625942,6625940,6625935,6625931,6625929,6625927,6625924,6625918,6625917,6625912,6625908,4989865,4920985,4920969,4843089,4842812,4842807,4842804,4842794,4842790,4842788,3194524,5515692,5497739,5497744,5497746,5515719,5515723,5515733,5515713';
imageSets[3] = '6626602,6626599,6626597,6626596,6626593,6626591,6626585,6626583,6626581,6626578,6626576,6626566,6626565,6626532,6626529,6626518,6625950,6625942,6625940,6625935,6625931,6625929,6625927,6625924,6625922,6625918,6625917,6625912,6625908,5515733,5515723,5515719,5515718,5515713,5515692,5515685,5515667,5515666,5497748,5497746,5497744,5497739,4989865,4920985,4920983,4920981,4920978,4920976,4920973,4920969';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/petermarsden/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/petermarsden/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 = 'Peter Marsden 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;
	}
}

			

