window.thumbnails = {};
															thumbnails[8555452] = clik.newPhoto({"id":8555452,"src":"Pippa_IGP2906_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8555452.html","width":130,"caption":"","height":195});
															thumbnails[8556605] = clik.newPhoto({"id":8556605,"src":"Christine__IGP1947_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556605.html","width":130,"caption":"","height":194});
															thumbnails[8556610] = clik.newPhoto({"id":8556610,"src":"Daniel_IMGP6537_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556610.html","width":130,"caption":"","height":194});
															thumbnails[8556612] = clik.newPhoto({"id":8556612,"src":"Dan_IGP1334_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556612.html","width":130,"caption":"","height":194});
															thumbnails[8556625] = clik.newPhoto({"id":8556625,"src":"Eileen__IGP1682_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556625.html","width":130,"caption":"","height":194});
															thumbnails[8556658] = clik.newPhoto({"id":8556658,"src":"Girl_In_Italy_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556658.html","width":130,"caption":"","height":200});
															thumbnails[8556666] = clik.newPhoto({"id":8556666,"src":"Renee_IMGP6845_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556666.html","width":130,"caption":"","height":184});
															thumbnails[8556670] = clik.newPhoto({"id":8556670,"src":"Renee_IMGP6861_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556670.html","width":130,"caption":"","height":194});
															thumbnails[8556671] = clik.newPhoto({"id":8556671,"src":"Renee_IMGP6883_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556671.html","width":130,"caption":"","height":194});
															thumbnails[8556673] = clik.newPhoto({"id":8556673,"src":"Rob_IGP2981_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556673.html","width":130,"caption":"","height":194});
															thumbnails[8556676] = clik.newPhoto({"id":8556676,"src":"Sam_IGP1133_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556676.html","width":130,"caption":"","height":194});
															thumbnails[8556677] = clik.newPhoto({"id":8556677,"src":"Sam_IGP2031_thumb.jpg","galleries_id":207831,"server_id":35,"link":"photo_8556677.html","width":130,"caption":"","height":194});
															thumbnails[8560049] = clik.newPhoto({"id":8560049,"src":"Renee_Centre_Spread_thumb.jpg","galleries_id":207831,"server_id":38,"link":"photo_8560049.html","width":130,"caption":"","height":130});
															thumbnails[8560112] = clik.newPhoto({"id":8560112,"src":"Fern_IGP2787_thumb.jpg","galleries_id":207831,"server_id":38,"link":"photo_8560112.html","width":130,"caption":"","height":130});
															thumbnails[8560113] = clik.newPhoto({"id":8560113,"src":"Sam_IGP2289_thumb.jpg","galleries_id":207831,"server_id":38,"link":"photo_8560113.html","width":130,"caption":"","height":130});
															thumbnails[8560117] = clik.newPhoto({"id":8560117,"src":"Sue_IMGP0369_thumb.jpg","galleries_id":207831,"server_id":38,"link":"photo_8560117.html","width":130,"caption":"","height":130});
															thumbnails[8560119] = clik.newPhoto({"id":8560119,"src":"Vanessa_IGP2695_thumb.jpg","galleries_id":207831,"server_id":38,"link":"photo_8560119.html","width":130,"caption":"","height":130});
															thumbnails[5266037] = clik.newPhoto({"id":5266037,"src":"Cheetah_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266037.html","width":130,"caption":"","height":130});
															thumbnails[5266038] = clik.newPhoto({"id":5266038,"src":"Rhino_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266038.html","width":130,"caption":"","height":130});
															thumbnails[5266044] = clik.newPhoto({"id":5266044,"src":"Otter1_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266044.html","width":130,"caption":"","height":130});
															thumbnails[5266046] = clik.newPhoto({"id":5266046,"src":"Otter3_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266046.html","width":130,"caption":"","height":130});
															thumbnails[5266048] = clik.newPhoto({"id":5266048,"src":"Pinemartin_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266048.html","width":130,"caption":"","height":130});
															thumbnails[5266122] = clik.newPhoto({"id":5266122,"src":"Black_Butterfly_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266122.html","width":130,"caption":"","height":130});
															thumbnails[5266124] = clik.newPhoto({"id":5266124,"src":"Tiger_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266124.html","width":130,"caption":"","height":130});
															thumbnails[5266126] = clik.newPhoto({"id":5266126,"src":"Red_Dear_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266126.html","width":130,"caption":"","height":130});
															thumbnails[5266127] = clik.newPhoto({"id":5266127,"src":"Badger_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266127.html","width":130,"caption":"","height":130});
															thumbnails[5266129] = clik.newPhoto({"id":5266129,"src":"Sparrowhawk_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266129.html","width":130,"caption":"","height":130});
															thumbnails[5266617] = clik.newPhoto({"id":5266617,"src":"Fallow_Deer_thumb.jpg","galleries_id":296399,"server_id":18,"link":"photo_5266617.html","width":130,"caption":"","height":130});
															thumbnails[2984545] = clik.newPhoto({"id":2984545,"src":"Martin_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_2984545.html","width":130,"caption":"Martin","height":130});
															thumbnails[2984547] = clik.newPhoto({"id":2984547,"src":"Sue_at_Work_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_2984547.html","width":130,"caption":"Dr Sue Howell","height":130});
															thumbnails[3402993] = clik.newPhoto({"id":3402993,"src":"Kendo_View_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3402993.html","width":130,"caption":"","height":130});
															thumbnails[3403025] = clik.newPhoto({"id":3403025,"src":"Splash_Down1_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403025.html","width":130,"caption":"","height":130});
															thumbnails[3403052] = clik.newPhoto({"id":3403052,"src":"Antique_Shop1_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403052.html","width":130,"caption":"Antiques","height":130});
															thumbnails[3403095] = clik.newPhoto({"id":3403095,"src":"Bell_Foundry1_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403095.html","width":130,"caption":"Bell Foundry","height":130});
															thumbnails[3403099] = clik.newPhoto({"id":3403099,"src":"Bird_Strike1_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403099.html","width":130,"caption":"Bird Strike","height":130});
															thumbnails[3403104] = clik.newPhoto({"id":3403104,"src":"Blackcountry_Museum_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403104.html","width":130,"caption":"Shopkeeper","height":130});
															thumbnails[3403108] = clik.newPhoto({"id":3403108,"src":"Blacksmith1_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403108.html","width":130,"caption":"Blacksmith","height":130});
															thumbnails[3403111] = clik.newPhoto({"id":3403111,"src":"Book_Binders_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403111.html","width":130,"caption":"Book Binders","height":130});
															thumbnails[3403139] = clik.newPhoto({"id":3403139,"src":"Diamond_cutter1_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403139.html","width":130,"caption":"Diamond Cutter","height":130});
															thumbnails[3403231] = clik.newPhoto({"id":3403231,"src":"Divers_One_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403231.html","width":130,"caption":"Scuba Diver","height":130});
															thumbnails[3403726] = clik.newPhoto({"id":3403726,"src":"Spores_in_dish1_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403726.html","width":130,"caption":"Petri Dish","height":130});
															thumbnails[3403733] = clik.newPhoto({"id":3403733,"src":"Stencil_Press_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403733.html","width":130,"caption":"Press","height":130});
															thumbnails[3403742] = clik.newPhoto({"id":3403742,"src":"USB_Port1_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403742.html","width":130,"caption":"USB Port","height":130});
															thumbnails[3403749] = clik.newPhoto({"id":3403749,"src":"Watch_Menders_Bench1_thumb.jpg","galleries_id":207835,"server_id":18,"link":"photo_3403749.html","width":130,"caption":"Work Bench","height":130});
															thumbnails[3346644] = clik.newPhoto({"id":3346644,"src":"Sue_Flashes_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3346644.html","width":130,"caption":"Flare Flashes","height":130});
															thumbnails[3346648] = clik.newPhoto({"id":3346648,"src":"Sue_Sad_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3346648.html","width":130,"caption":"Depression","height":130});
															thumbnails[3402936] = clik.newPhoto({"id":3402936,"src":"Andy1_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3402936.html","width":130,"caption":"","height":130});
															thumbnails[3402997] = clik.newPhoto({"id":3402997,"src":"Mary_thumb.JPG","galleries_id":207836,"server_id":18,"link":"photo_3402997.html","width":130,"caption":"","height":130});
															thumbnails[3403001] = clik.newPhoto({"id":3403001,"src":"Neapolitan_Child1_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3403001.html","width":130,"caption":"","height":130});
															thumbnails[3403015] = clik.newPhoto({"id":3403015,"src":"Renee_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3403015.html","width":130,"caption":"","height":130});
															thumbnails[3403979] = clik.newPhoto({"id":3403979,"src":"Bollinger_Reflection_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3403979.html","width":130,"caption":"Bollinger","height":130});
															thumbnails[3403994] = clik.newPhoto({"id":3403994,"src":"Double_Vision_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3403994.html","width":130,"caption":"Double Vision","height":130});
															thumbnails[3404003] = clik.newPhoto({"id":3404003,"src":"Frost_on_Leaves1_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404003.html","width":130,"caption":"Frosty Leaves","height":130});
															thumbnails[3404020] = clik.newPhoto({"id":3404020,"src":"Fungi_on_tree_stump1_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404020.html","width":130,"caption":"Tree stump","height":130});
															thumbnails[3404025] = clik.newPhoto({"id":3404025,"src":"Gargoyle_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404025.html","width":130,"caption":"Gargoyle","height":130});
															thumbnails[3404036] = clik.newPhoto({"id":3404036,"src":"Grasses1_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404036.html","width":130,"caption":"Grasses","height":130});
															thumbnails[3404051] = clik.newPhoto({"id":3404051,"src":"Moth_Orchid_(Phalaenopsis)1_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404051.html","width":130,"caption":"Moth Orchid","height":130});
															thumbnails[3404065] = clik.newPhoto({"id":3404065,"src":"Old_Tree1_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404065.html","width":130,"caption":"Old Tree","height":130});
															thumbnails[3404085] = clik.newPhoto({"id":3404085,"src":"Raindrops1_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404085.html","width":130,"caption":"Rain Drops","height":130});
															thumbnails[3404101] = clik.newPhoto({"id":3404101,"src":"Reflections_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404101.html","width":130,"caption":"Reflections","height":130});
															thumbnails[3404106] = clik.newPhoto({"id":3404106,"src":"RockConcert_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404106.html","width":130,"caption":"Rock Concert","height":130});
															thumbnails[3404140] = clik.newPhoto({"id":3404140,"src":"Waterfall_RHS_Wisley_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3404140.html","width":130,"caption":"Waterfall","height":130});
															thumbnails[3446542] = clik.newPhoto({"id":3446542,"src":"Bee_On_Sunflower_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3446542.html","width":130,"caption":"Bee on sunflower","height":130});
															thumbnails[3446560] = clik.newPhoto({"id":3446560,"src":"Silentpool_Waterfall_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3446560.html","width":130,"caption":"Silent Pool","height":130});
															thumbnails[3446568] = clik.newPhoto({"id":3446568,"src":"Swans_PrioryPark_Lake_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3446568.html","width":130,"caption":"Swans","height":130});
															thumbnails[3446600] = clik.newPhoto({"id":3446600,"src":"Model_in_Tree_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3446600.html","width":130,"caption":"Model in tree","height":130});
															thumbnails[3851302] = clik.newPhoto({"id":3851302,"src":"Nude_Lamp_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3851302.html","width":130,"caption":"Nude_Lamp","height":130});
															thumbnails[3851304] = clik.newPhoto({"id":3851304,"src":"Nude_Table_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3851304.html","width":130,"caption":"Nude_Table","height":130});
															thumbnails[3908278] = clik.newPhoto({"id":3908278,"src":"Nude_Clock_thumb.jpg","galleries_id":207836,"server_id":18,"link":"photo_3908278.html","width":130,"caption":"Nude Clock","height":130});
															thumbnails[8594569] = clik.newPhoto({"id":8594569,"src":"Bolton_Castle_thumb.jpg","galleries_id":207836,"server_id":35,"link":"photo_8594569.html","width":130,"caption":"","height":130});
															thumbnails[3349498] = clik.newPhoto({"id":3349498,"src":"Craigory_Woods_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3349498.html","width":130,"caption":"Craigory Woods","height":130});
															thumbnails[3349501] = clik.newPhoto({"id":3349501,"src":"Guildford_Castle_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3349501.html","width":130,"caption":"Guildford Castle","height":130});
															thumbnails[3349541] = clik.newPhoto({"id":3349541,"src":"Little_Morden_Hall_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3349541.html","width":130,"caption":"Little Moreton Hall<br>\r\n","height":130});
															thumbnails[3404192] = clik.newPhoto({"id":3404192,"src":"Birmingham_canal1_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404192.html","width":130,"caption":"Birmingham Canal","height":130});
															thumbnails[3404200] = clik.newPhoto({"id":3404200,"src":"Bromley_by_Bow1_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404200.html","width":130,"caption":"London Canal","height":130});
															thumbnails[3404216] = clik.newPhoto({"id":3404216,"src":"Corfe_Castle1_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404216.html","width":130,"caption":"Corfe Castle","height":130});
															thumbnails[3404223] = clik.newPhoto({"id":3404223,"src":"Cyprus_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404223.html","width":130,"caption":"Door to nowhere","height":130});
															thumbnails[3404233] = clik.newPhoto({"id":3404233,"src":"Devon_Coast1_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404233.html","width":130,"caption":"Coastline","height":130});
															thumbnails[3404239] = clik.newPhoto({"id":3404239,"src":"Hong_Kong_Airport1_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404239.html","width":130,"caption":"Airport","height":130});
															thumbnails[3404253] = clik.newPhoto({"id":3404253,"src":"Iceland_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404253.html","width":130,"caption":"Cold Landscape","height":130});
															thumbnails[3404275] = clik.newPhoto({"id":3404275,"src":"Jesi_Steps_Italy1_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404275.html","width":130,"caption":"Steps","height":130});
															thumbnails[3404289] = clik.newPhoto({"id":3404289,"src":"Omapere_Bay_NZ1_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404289.html","width":130,"caption":"Sea View","height":130});
															thumbnails[3404558] = clik.newPhoto({"id":3404558,"src":"Sky_Tower_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_3404558.html","width":130,"caption":"Sky Tower","height":130});
															thumbnails[8594572] = clik.newPhoto({"id":8594572,"src":"Malham_thumb.jpg","galleries_id":207838,"server_id":35,"link":"photo_8594572.html","width":130,"caption":"","height":130});
															thumbnails[8594576] = clik.newPhoto({"id":8594576,"src":"Ribbledale_thumb.jpg","galleries_id":207838,"server_id":35,"link":"photo_8594576.html","width":130,"caption":"","height":130});
															thumbnails[8594578] = clik.newPhoto({"id":8594578,"src":"Richmond_thumb.jpg","galleries_id":207838,"server_id":35,"link":"photo_8594578.html","width":130,"caption":"","height":130});
															thumbnails[1846788] = clik.newPhoto({"id":1846788,"src":"Wharkawa_Wildlife_Refuge_thumb.jpg","galleries_id":207838,"server_id":18,"link":"photo_1846788.html","width":130,"caption":"Wharekawa Wildlife Refuge","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[207831] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"section385212.html","maxRecords":0.0,"photoIDs":[8555452.0,8556605.0,8556610.0,8556612.0,8556625.0,8556658.0,8556666.0,8556670.0,8556671.0,8556673.0,8556676.0,8556677.0,8560049.0,8560112.0,8560113.0,8560117.0,8560119.0],"skipIndex":0,"section_code":"section385212","featured_images":"8560119,8560117,8560113,8560112,8560049,8556677,8556676,8556673,8556671,8556670","id":207831,"singleSection":true});				  						galleries[207836] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photo Art","link":"section385350.html","maxRecords":0.0,"photoIDs":[3346644.0,3346648.0,3402936.0,3402997.0,3403001.0,3403015.0,3403979.0,3403994.0,3404003.0,3404020.0,3404025.0,3404036.0,3404051.0,3404065.0,3404085.0,3404101.0,3404106.0,3404140.0,3446542.0,3446560.0,3446568.0,3446600.0,3851302.0,3851304.0,3908278.0,8594569.0],"skipIndex":0,"section_code":"section385350","featured_images":"8594569,3908278,3851304,3851302,3446600,3446568,3446560,3446542,3404140,3404106","id":207836,"singleSection":true});				  						galleries[207838] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Travel","link":"section385351.html","maxRecords":0.0,"photoIDs":[3349498.0,3349501.0,3349541.0,3404192.0,3404200.0,3404216.0,3404223.0,3404233.0,3404239.0,3404253.0,3404275.0,3404289.0,3404558.0,8594572.0,8594576.0,8594578.0,1846788.0],"skipIndex":0,"section_code":"section385351","featured_images":"8594578,8594576,8594572,3404558,3404289,3404275,3404253,3404239,3404233,3404223","id":207838,"singleSection":true});				  						galleries[207835] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Commercial","link":"section385349.html","maxRecords":0.0,"photoIDs":[2984545.0,2984547.0,3402993.0,3403025.0,3403052.0,3403095.0,3403099.0,3403104.0,3403108.0,3403111.0,3403139.0,3403231.0,3403726.0,3403733.0,3403742.0,3403749.0],"skipIndex":0,"section_code":"section385349","featured_images":"3403749,3403742,3403733,3403726,3403231,3403139,3403111,3403108,3403104,3403099","id":207835,"singleSection":true});				  						galleries[296399] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife","link":"section385347.html","maxRecords":0.0,"photoIDs":[5266037.0,5266038.0,5266044.0,5266046.0,5266048.0,5266122.0,5266124.0,5266126.0,5266127.0,5266129.0,5266617.0],"skipIndex":0,"section_code":"section385347","featured_images":"5266617,5266129,5266127,5266126,5266124,5266122,5266048,5266046,5266044,5266038","id":296399,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8594578,8594576,8594572,8560119,8560117,8560113,8560112,8560049,8556677,8556676,8556670,8556666,8556658,8556610,8555452,5266037,3908278,3851302,3446568,3446560,3404289,3404216,3404025,3403994,3403742,3403104,3403095,3403025,3402936,3349541';
imageSets[3] = '8556670';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/alanamesbury/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/alanamesbury/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Alan Amesbury 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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp += '<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;
	}
}

			

