window.thumbnails = {};
															thumbnails[3202991] = clik.newPhoto({"id":3202991,"src":"fly_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":184});
															thumbnails[3203674] = clik.newPhoto({"id":3203674,"src":"Peter scott march 1980_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"RECEIVING AWARD FROM SIR PETER SCOTT.","height":172});
															thumbnails[3203675] = clik.newPhoto({"id":3203675,"src":"Eric Hosking 1980_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"MEETING ERIC HOSKING","height":98});
															thumbnails[5550899] = clik.newPhoto({"id":5550899,"src":"_D308439_copy_2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"SHETLAND PONY","height":89});
															thumbnails[7055143] = clik.newPhoto({"id":7055143,"src":"0014_Griffon_Vulture_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Griffon Vulture","height":87});
															thumbnails[7100885] = clik.newPhoto({"id":7100885,"src":"BULLFINCH1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"BULLFINCH","height":171});
															thumbnails[7158432] = clik.newPhoto({"id":7158432,"src":"5923_Bearded_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Bearded Tit","height":89});
															thumbnails[7167424] = clik.newPhoto({"id":7167424,"src":"Stoat_6253_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Weasel in the snow 6253","height":76});
															thumbnails[3106791] = clik.newPhoto({"id":3106791,"src":"1409 RPS_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Grey seal","height":89});
															thumbnails[7158441] = clik.newPhoto({"id":7158441,"src":"5992_Bearded__thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Bearded tit","height":190});
															thumbnails[5550896] = clik.newPhoto({"id":5550896,"src":"_D308433_copy_2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"SHETLAND IN SNOW","height":190});
															thumbnails[5450404] = clik.newPhoto({"id":5450404,"src":"7936-Shetland_in_the_snow_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Shetland in the snow","height":89});
															thumbnails[5450419] = clik.newPhoto({"id":5450419,"src":"Frenchie_7561_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_5450419.html","width":130,"caption":"Frenchie","height":89});
															thumbnails[7114904] = clik.newPhoto({"id":7114904,"src":"0771_Rainbow_moment1_thumb.jpg","galleries_id":378353,"server_id":1,"link":"photo_7114904.html","width":130,"caption":"0771 RAINBOW MOMENT","height":91});
															thumbnails[7678054] = clik.newPhoto({"id":7678054,"src":"0707_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_7678054.html","width":130,"caption":"Who, me?","height":109});
															thumbnails[7678058] = clik.newPhoto({"id":7678058,"src":"0721_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_7678058.html","width":130,"caption":"Oh is that really for me?","height":89});
															thumbnails[7678156] = clik.newPhoto({"id":7678156,"src":"4590_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_7678156.html","width":130,"caption":"For my nest. 1.","height":82});
															thumbnails[7678169] = clik.newPhoto({"id":7678169,"src":"4691_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_7678169.html","width":130,"caption":"It's for my nest.","height":84});
															thumbnails[7678190] = clik.newPhoto({"id":7678190,"src":"5183_thumb.jpg","galleries_id":378353,"server_id":1,"link":"photo_7678190.html","width":130,"caption":"Grey Squirrel","height":178});
															thumbnails[7678070] = clik.newPhoto({"id":7678070,"src":"1084_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_7678070.html","width":130,"caption":"Feathered finery.","height":88});
															thumbnails[8181898] = clik.newPhoto({"id":8181898,"src":"_MG_8031_copy_thumb.jpg","galleries_id":430125,"server_id":37,"link":"photo_8181898.html","width":130,"caption":"Dragonfly","height":87});
															thumbnails[8190893] = clik.newPhoto({"id":8190893,"src":"Caretta_Caretta_LOGGERHEAD_TURTLE.0476_thumb.jpg","galleries_id":430125,"server_id":35,"link":"photo_8190893.html","width":130,"caption":"Loggerhead Turtle","height":86});
															thumbnails[3106747] = clik.newPhoto({"id":3106747,"src":"1159_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_3106747.html","width":130,"caption":"Blackbird","height":93});
															thumbnails[5302274] = clik.newPhoto({"id":5302274,"src":"6716__thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_5302274.html","width":130,"caption":"Orange on White","height":89});
															thumbnails[3321575] = clik.newPhoto({"id":3321575,"src":"CLIKPIC ROE1_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_3321575.html","width":130,"caption":"Roe Deer in Wheatfield","height":183});
															thumbnails[4981704] = clik.newPhoto({"id":4981704,"src":"snowy_owl_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_4981704.html","width":130,"caption":"Snowy Owl","height":89});
															thumbnails[2467931] = clik.newPhoto({"id":2467931,"src":"CP- Whoopers_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_2467931.html","width":130,"caption":"","height":89});
															thumbnails[2467955] = clik.newPhoto({"id":2467955,"src":"CP-Leaping Rainbow with fly_thumb..jpg","galleries_id":131228,"server_id":1,"link":"photo_2467955.html","width":130,"caption":"LEAPING RAINBOW TROUT","height":85});
															thumbnails[2467967] = clik.newPhoto({"id":2467967,"src":"CP-whoopers-2_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_2467967.html","width":130,"caption":"","height":89});
															thumbnails[3081795] = clik.newPhoto({"id":3081795,"src":"0973- GREY SEAL PUP 1 copy_thumb.jpg","galleries_id":131228,"server_id":1,"link":"photo_3081795.html","width":130,"caption":"Grey Seal Pup. 1","height":89});
															thumbnails[2467915] = clik.newPhoto({"id":2467915,"src":"CP- Barnacles_thumb.jpg","galleries_id":131228,"server_id":1,"link":"photo_2467915.html","width":130,"caption":"ROOSTING BARNACLE GEESE","height":55});
															thumbnails[2467926] = clik.newPhoto({"id":2467926,"src":"CP- Lapwing_thumb.jpg","galleries_id":378352,"server_id":1,"link":"photo_2467926.html","width":130,"caption":"Blowing in the wind.","height":81});
															thumbnails[8021040] = clik.newPhoto({"id":8021040,"src":"kes_1_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8021040.html","width":130,"caption":"Too soon to photograph the kestrel with chicks.","height":87});
															thumbnails[8021047] = clik.newPhoto({"id":8021047,"src":"kes_2_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8021047.html","width":130,"caption":"Kestrel with chicks hatched 13th June","height":105});
															thumbnails[8028294] = clik.newPhoto({"id":8028294,"src":"Poppy_4418_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8028294.html","width":130,"caption":"It's poppy time.","height":93});
															thumbnails[6285265] = clik.newPhoto({"id":6285265,"src":"CP_273-67_Maitreya_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_6285265.html","width":130,"caption":"Maitreya Buddah. Meditation. Meditating.","height":163});
															thumbnails[7055148] = clik.newPhoto({"id":7055148,"src":"6720_Glasswing__thumb.jpg","galleries_id":378354,"server_id":1,"link":"photo_7055148.html","width":130,"caption":"Glasswing Butterfly","height":184});
															thumbnails[8028301] = clik.newPhoto({"id":8028301,"src":"Poppy_4473_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8028301.html","width":130,"caption":"Poppies in the wind","height":93});
															thumbnails[8028321] = clik.newPhoto({"id":8028321,"src":"Poppy_4601_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8028321.html","width":130,"caption":"Ladies in red.","height":170});
															thumbnails[2467920] = clik.newPhoto({"id":2467920,"src":"CP- HERON_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2467920.html","width":130,"caption":"","height":186});
															thumbnails[8050966] = clik.newPhoto({"id":8050966,"src":"dd4_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8050966.html","width":130,"caption":"Avocet chicks","height":87});
															thumbnails[5267741] = clik.newPhoto({"id":5267741,"src":"Little_Egret-0446__thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_5267741.html","width":130,"caption":"Little Egret","height":190});
															thumbnails[8058444] = clik.newPhoto({"id":8058444,"src":"D1_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8058444.html","width":130,"caption":"MALLARD DUCKLING","height":88});
															thumbnails[8050970] = clik.newPhoto({"id":8050970,"src":"dd7_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8050970.html","width":130,"caption":"Avocet chick","height":91});
															thumbnails[8058447] = clik.newPhoto({"id":8058447,"src":"D2_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8058447.html","width":130,"caption":"In the swimming pool.","height":88});
															thumbnails[8058515] = clik.newPhoto({"id":8058515,"src":"D3_thumb.jpg","galleries_id":430125,"server_id":1,"link":"photo_8058515.html","width":130,"caption":"29th June. Exploring its new world.","height":86});
															thumbnails[2467966] = clik.newPhoto({"id":2467966,"src":"CP-Mute Swan_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2467966.html","width":130,"caption":"","height":181});
															thumbnails[2467934] = clik.newPhoto({"id":2467934,"src":"CP- WOOD SANDPIPER_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2467934.html","width":130,"caption":"","height":300});
															thumbnails[2467805] = clik.newPhoto({"id":2467805,"src":"CP-4915_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2467805.html","width":130,"caption":"","height":181});
															thumbnails[8071307] = clik.newPhoto({"id":8071307,"src":"family_doing_well_thumb.jpg","galleries_id":430125,"server_id":37,"link":"photo_8071307.html","width":130,"caption":"The family are growing up","height":87});
															thumbnails[2467795] = clik.newPhoto({"id":2467795,"src":"CP-0793 _thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2467795.html","width":130,"caption":"","height":177});
															thumbnails[8071427] = clik.newPhoto({"id":8071427,"src":"family_2_thumb.jpg","galleries_id":430125,"server_id":37,"link":"photo_8071427.html","width":130,"caption":"Trying out his wings.","height":87});
															thumbnails[2470003] = clik.newPhoto({"id":2470003,"src":"7376_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2470003.html","width":130,"caption":"Blue Eyes.","height":191});
															thumbnails[2332301] = clik.newPhoto({"id":2332301,"src":"Honeysuckle_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2332301.html","width":130,"caption":"Honeysuckle","height":181});
															thumbnails[2470001] = clik.newPhoto({"id":2470001,"src":"CP-KINGFISHER-4911_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2470001.html","width":130,"caption":"","height":187});
															thumbnails[1958804] = clik.newPhoto({"id":1958804,"src":"46_thumb. Mute Swan & chicks.jpg","galleries_id":127866,"server_id":1,"link":"photo_1958804.html","width":130,"caption":"Mute Swan & Chicks. ","height":196});
															thumbnails[2467947] = clik.newPhoto({"id":2467947,"src":"CP-Common Snipe_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2467947.html","width":130,"caption":"","height":175});
															thumbnails[2467865] = clik.newPhoto({"id":2467865,"src":"CP-8842_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2467865.html","width":130,"caption":"","height":186});
															thumbnails[2467863] = clik.newPhoto({"id":2467863,"src":"CP-8652 BLACK TAILED GODWIT_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_2467863.html","width":130,"caption":"","height":161});
															thumbnails[1977587] = clik.newPhoto({"id":1977587,"src":"4082_Reed Warbler 1_thumb.jpg","galleries_id":127866,"server_id":1,"link":"photo_1977587.html","width":130,"caption":"Reed Warbler. ","height":231});
															thumbnails[2467776] = clik.newPhoto({"id":2467776,"src":"5904-Sanderling_thumb.jpg","galleries_id":131228,"server_id":1,"link":"photo_2467776.html","width":130,"caption":"","height":91});
															thumbnails[2470002] = clik.newPhoto({"id":2470002,"src":"529_thumb.jpg","galleries_id":131228,"server_id":1,"link":"photo_2470002.html","width":130,"caption":"Grey Seal. <br>\r\nGlobal Warmin, yeh, bring it on...","height":99});
															thumbnails[2467950] = clik.newPhoto({"id":2467950,"src":"CP-Greenshank with fish_thumb.jpg","galleries_id":131228,"server_id":1,"link":"photo_2467950.html","width":130,"caption":"","height":89});
															thumbnails[3794273] = clik.newPhoto({"id":3794273,"src":"Gannet-7096_thumb.jpg","galleries_id":131228,"server_id":1,"link":"photo_3794273.html","width":130,"caption":"Gannet. Bempton Cliffs.","height":92});
															thumbnails[5117836] = clik.newPhoto({"id":5117836,"src":"1477_TIME__TIDE_thumb.jpg","galleries_id":131228,"server_id":1,"link":"photo_5117836.html","width":130,"caption":"TIME & TIDE","height":77});
															thumbnails[2467858] = clik.newPhoto({"id":2467858,"src":"CP-8329 Barred Warbler_thumb.jpg","galleries_id":131228,"server_id":1,"link":"photo_2467858.html","width":130,"caption":"","height":89});
															thumbnails[2467969] = clik.newPhoto({"id":2467969,"src":"Spurn Lighthouse 11_thumb.jpg","galleries_id":131228,"server_id":1,"link":"photo_2467969.html","width":130,"caption":"SPURN LIGHTHOUSE","height":90});
															thumbnails[3202332] = clik.newPhoto({"id":3202332,"src":"TROUT copy_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_3202332.html","width":130,"caption":"","height":181});
															thumbnails[3202381] = clik.newPhoto({"id":3202381,"src":"BIRDWATCH copy_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_3202381.html","width":130,"caption":"","height":183});
															thumbnails[3202987] = clik.newPhoto({"id":3202987,"src":"birdwatch razorbill_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_3202987.html","width":130,"caption":"","height":181});
															thumbnails[3202989] = clik.newPhoto({"id":3202989,"src":"fisherman_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_3202989.html","width":130,"caption":"","height":184});
															thumbnails[3202992] = clik.newPhoto({"id":3202992,"src":"snipe_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_3202992.html","width":130,"caption":"","height":180});
															thumbnails[3203668] = clik.newPhoto({"id":3203668,"src":"Babette Cole-LL Nov 1998_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_3203668.html","width":130,"caption":"Babette Cole. Children's author. LINCOLNSHIRE LIFE.","height":179});
															thumbnails[3203670] = clik.newPhoto({"id":3203670,"src":"LT Cyprus_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_3203670.html","width":130,"caption":"LINCOLNSHIRE TODAY","height":191});
															thumbnails[3203672] = clik.newPhoto({"id":3203672,"src":"LT Spain_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_3203672.html","width":130,"caption":"LINCOLNSHIRE TODAY","height":190});
															thumbnails[5811264] = clik.newPhoto({"id":5811264,"src":"4-8299_Grainsby_Hall_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_5811264.html","width":130,"caption":"Grainsby Hall. Lincolnshire.","height":91});
															thumbnails[5811294] = clik.newPhoto({"id":5811294,"src":"1036-Old_Flamborough_Lighthouse_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_5811294.html","width":130,"caption":"Old Flamborough Lighthouse. (Before someone 'emulsioned' it !)","height":185});
															thumbnails[7372587] = clik.newPhoto({"id":7372587,"src":"2_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_7372587.html","width":130,"caption":"FIELDSPORTS","height":157});
															thumbnails[7372601] = clik.newPhoto({"id":7372601,"src":"3_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_7372601.html","width":130,"caption":"","height":183});
															thumbnails[7372604] = clik.newPhoto({"id":7372604,"src":"4_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_7372604.html","width":130,"caption":"LINCOLNSHIRE TODAY","height":185});
															thumbnails[7372607] = clik.newPhoto({"id":7372607,"src":"11_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_7372607.html","width":130,"caption":"","height":191});
															thumbnails[7372609] = clik.newPhoto({"id":7372609,"src":"12_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_7372609.html","width":130,"caption":"SEA ANGLING","height":190});
															thumbnails[7372610] = clik.newPhoto({"id":7372610,"src":"15_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_7372610.html","width":130,"caption":"","height":182});
															thumbnails[7372612] = clik.newPhoto({"id":7372612,"src":"17_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_7372612.html","width":130,"caption":"MEETING ERIC HOSKING 1980","height":100});
															thumbnails[3202297] = clik.newPhoto({"id":3202297,"src":"undergrowth copy_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_3202297.html","width":130,"caption":"","height":180});
															thumbnails[7372599] = clik.newPhoto({"id":7372599,"src":"1_thumb.jpg","galleries_id":328955,"server_id":1,"link":"photo_7372599.html","width":130,"caption":"LINCOLNSHIRE LIFE","height":181});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[378352] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"BIRDS","link":"gallery_378352.html","maxRecords":0.0,"photoIDs":[5450419.0,7678054.0,7678058.0,7678156.0,7678169.0,7678070.0,3106747.0,5302274.0,4981704.0,2467931.0,2467967.0,2467926.0],"skipIndex":0,"section_code":"gallery","featured_images":7678070.0,"id":378352,"singleSection":false});				  						galleries[430125] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Daily Diary","link":"gallery_430125.html","maxRecords":0.0,"photoIDs":[8181898.0,8190893.0,8021040.0,8021047.0,8028294.0,8028301.0,8028321.0,8050966.0,8058444.0,8050970.0,8058447.0,8058515.0,8071307.0,8071427.0],"skipIndex":0,"section_code":"gallery","featured_images":"8190893,8181898,8071427,8071307,8058515,8058447,8058444,8050970,8050966,8028321","id":430125,"singleSection":false});				  						galleries[378354] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"INSECTS","link":"gallery_378354.html","maxRecords":0.0,"photoIDs":[7055148.0],"skipIndex":0,"section_code":"gallery","featured_images":7055148.0,"id":378354,"singleSection":false});				  						galleries[378353] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"MAMMALS","link":"gallery_378353.html","maxRecords":0.0,"photoIDs":[7114904.0,7678190.0],"skipIndex":0,"section_code":"gallery","featured_images":"7678190,7114904","id":378353,"singleSection":false});				  						galleries[328955] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PUBLISHED WORK","link":"section394160.html","maxRecords":0.0,"photoIDs":[3202332.0,3202381.0,3202987.0,3202989.0,3202992.0,3203668.0,3203670.0,3203672.0,5811264.0,5811294.0,7372587.0,7372601.0,7372604.0,7372607.0,7372609.0,7372610.0,7372612.0,3202297.0,7372599.0],"skipIndex":0,"section_code":"section394160","featured_images":7372599.0,"id":328955,"singleSection":true});				  						galleries[127866] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PORTRAIT FORMAT","link":"gallery_127866.html","maxRecords":0.0,"photoIDs":[3321575.0,6285265.0,2467920.0,5267741.0,2467966.0,2467934.0,2467805.0,2467795.0,2470003.0,2332301.0,2470001.0,1958804.0,2467947.0,2467865.0,2467863.0,1977587.0],"skipIndex":0,"section_code":"gallery","featured_images":"6285265,5267741,3321575,2470003,2470001,2467966,2467947,2467934,2467920,2467865","id":127866,"singleSection":false});				  						galleries[131228] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape format","link":"gallery_131228.html","maxRecords":0.0,"photoIDs":[2467955.0,3081795.0,2467915.0,2467776.0,2470002.0,2467950.0,3794273.0,5117836.0,2467858.0,2467969.0],"skipIndex":0,"section_code":"gallery","featured_images":"5117836,3794273,3081795,2470002,2467969,2467955,2467950,2467915,2467858,2467776","id":131228,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[234838] = '7678070,7055148,6285265';
imageSets[234839] = '6285265';
imageSets[1] = '7678070,7167424,7158441,7055148,6285265,5550896,5302274,4981704,3321575,3202297,3106791,2467967,2467955,2467934,2467931,2467926,2467920';
imageSets[2] = '7678070,7372599,7055148';
imageSets[3] = '7678070,5550896,5450404,5117836,4981704,3321575,3106791';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/fotolincs/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/fotolincs/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 = 'FOTOLINCS: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal: </p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="fotolincs@ntlworld.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart \" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="fotolincs@ntlworld.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart \" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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({					href: thumbnails[imageID].fnGalleryLink(gallery_id),					title: galleries[gallery_id].title				});
			}
		}
	}
}

/***************************************************************************
* 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;
	}
}

			

