window.thumbnails = {};
															thumbnails[2487499] = clik.newPhoto({"id":2487499,"src":"DSC_0006bluetit2_thumb.jpg","galleries_id":159639,"server_id":32,"link":"photo_2487499.html","width":130,"caption":"blue tit parent","height":107});
															thumbnails[2487502] = clik.newPhoto({"id":2487502,"src":"DSC_0009bjuzzard_thumb.jpg","galleries_id":159639,"server_id":32,"link":"photo_2487502.html","width":130,"caption":"wild buzzard","height":121});
															thumbnails[2487508] = clik.newPhoto({"id":2487508,"src":"DSC_0082malechaff1_thumb.jpg","galleries_id":159639,"server_id":32,"link":"photo_2487508.html","width":130,"caption":"Male Chaffinch","height":96});
															thumbnails[2487513] = clik.newPhoto({"id":2487513,"src":"fledgelingbluetit_thumb.jpg","galleries_id":159639,"server_id":32,"link":"photo_2487513.html","width":130,"caption":"Fledgling blue tit","height":86});
															thumbnails[2487603] = clik.newPhoto({"id":2487603,"src":"DSC_0055mouse1_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_2487603.html","width":130,"caption":"wood mouse","height":86});
															thumbnails[2487605] = clik.newPhoto({"id":2487605,"src":"otter1_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_2487605.html","width":130,"caption":"otter","height":89});
															thumbnails[2491384] = clik.newPhoto({"id":2491384,"src":"DSC_0007rose2_thumb.jpg","galleries_id":159640,"server_id":32,"link":"photo_2491384.html","width":130,"caption":"Red rose 2","height":86});
															thumbnails[2491389] = clik.newPhoto({"id":2491389,"src":"DSC_0030poppies_thumb.jpg","galleries_id":159640,"server_id":32,"link":"photo_2491389.html","width":130,"caption":"red on blue","height":91});
															thumbnails[2491390] = clik.newPhoto({"id":2491390,"src":"redpoppiesongrey_thumb.jpg","galleries_id":159640,"server_id":32,"link":"photo_2491390.html","width":130,"caption":"red on grey","height":91});
															thumbnails[2491391] = clik.newPhoto({"id":2491391,"src":"Any barn in a storm_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_2491391.html","width":130,"caption":"Any barn in a storm","height":86});
															thumbnails[2491395] = clik.newPhoto({"id":2491395,"src":"ciderorchard_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_2491395.html","width":130,"caption":"The cider orchard","height":86});
															thumbnails[2491399] = clik.newPhoto({"id":2491399,"src":"DSC_0007Torbryanchurch1_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_2491399.html","width":130,"caption":"Torbryan church","height":94});
															thumbnails[2495701] = clik.newPhoto({"id":2495701,"src":"DSC_0005_thumb.jpg","galleries_id":159640,"server_id":32,"link":"photo_2495701.html","width":130,"caption":"poppies","height":86});
															thumbnails[2495718] = clik.newPhoto({"id":2495718,"src":"DSC_0036yellowpoppy_thumb.jpg","galleries_id":159640,"server_id":32,"link":"photo_2495718.html","width":130,"caption":"Californian poppies","height":86});
															thumbnails[2495748] = clik.newPhoto({"id":2495748,"src":"DSC_0058rose1_thumb.jpg","galleries_id":159640,"server_id":32,"link":"photo_2495748.html","width":130,"caption":"Red rose","height":86});
															thumbnails[3324658] = clik.newPhoto({"id":3324658,"src":"DSC_0082mouseclikpic_thumb.jpg","galleries_id":159393,"server_id":32,"link":"photo_3324658.html","width":130,"caption":"","height":107});
															thumbnails[3324662] = clik.newPhoto({"id":3324662,"src":"DSC_0083otterclikpic_thumb.jpg","galleries_id":159393,"server_id":32,"link":"photo_3324662.html","width":130,"caption":"","height":102});
															thumbnails[3324663] = clik.newPhoto({"id":3324663,"src":"DSC_0085lakeclikpic_thumb.jpg","galleries_id":159393,"server_id":32,"link":"photo_3324663.html","width":130,"caption":"","height":106});
															thumbnails[3324664] = clik.newPhoto({"id":3324664,"src":"DSC_0086robinclikpic_thumb.jpg","galleries_id":159393,"server_id":32,"link":"photo_3324664.html","width":130,"caption":"","height":104});
															thumbnails[3517755] = clik.newPhoto({"id":3517755,"src":"fur seal 2clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_3517755.html","width":130,"caption":"Fur Seal","height":86});
															thumbnails[3579120] = clik.newPhoto({"id":3579120,"src":"DSC_0044blacknecked_stiltclik_thumb.jpg","galleries_id":159639,"server_id":32,"link":"photo_3579120.html","width":94,"caption":"Black-necked Stilt 5","height":130});
															thumbnails[3620936] = clik.newPhoto({"id":3620936,"src":"DSC_0056_2female_squirrelclik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_3620936.html","width":130,"caption":"Female squirrel","height":93});
															thumbnails[3874206] = clik.newPhoto({"id":3874206,"src":"babybluetitclik_thumb.jpg","galleries_id":159639,"server_id":32,"link":"photo_3874206.html","width":93,"caption":"Fledgling blue tit","height":130});
															thumbnails[4230885] = clik.newPhoto({"id":4230885,"src":"Sunset_panorama_over_the_DartClik_thumb.jpg","galleries_id":159394,"server_id":32,"link":"photo_4230885.html","width":130,"caption":"Sunset above the Dart valley","height":45});
															thumbnails[4410809] = clik.newPhoto({"id":4410809,"src":"243_pr_ottersclik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_4410809.html","width":130,"caption":"Pair of otters","height":86});
															thumbnails[4410816] = clik.newPhoto({"id":4410816,"src":"DSC_0130you_looking_at_meclik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_4410816.html","width":130,"caption":"You lookin' at me?","height":91});
															thumbnails[4410824] = clik.newPhoto({"id":4410824,"src":"DSC_0137otter_3clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_4410824.html","width":130,"caption":"I can see you!","height":86});
															thumbnails[4410828] = clik.newPhoto({"id":4410828,"src":"DSC_0181otter_1clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_4410828.html","width":130,"caption":"otter","height":86});
															thumbnails[4410835] = clik.newPhoto({"id":4410835,"src":"DSC_0275black_swallowtailclik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_4410835.html","width":130,"caption":"Swallowtail butterfly","height":90});
															thumbnails[4547390] = clik.newPhoto({"id":4547390,"src":"frazzled_adultclik_thumb.jpg","galleries_id":159639,"server_id":32,"link":"photo_4547390.html","width":130,"caption":"Frazzled blue tit","height":86});
															thumbnails[4857981] = clik.newPhoto({"id":4857981,"src":"DSC_0113full_orange_roseclik_thumb.jpg","galleries_id":159640,"server_id":32,"link":"photo_4857981.html","width":130,"caption":"orange rose","height":86});
															thumbnails[4857987] = clik.newPhoto({"id":4857987,"src":"DSC_0151orange_rose1clik_thumb.jpg","galleries_id":159640,"server_id":32,"link":"photo_4857987.html","width":86,"caption":"orange rose 2","height":130});
															thumbnails[4999851] = clik.newPhoto({"id":4999851,"src":"NLM_0199Southern_Hawker_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_4999851.html","width":130,"caption":"Dragonfly","height":86});
															thumbnails[5122806] = clik.newPhoto({"id":5122806,"src":"smoke2clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_5122806.html","width":130,"caption":"Smoke over Torbryan church","height":98});
															thumbnails[5266173] = clik.newPhoto({"id":5266173,"src":"blackmore_vale_8shot_panoramafinishedclik_thumb.jpg","galleries_id":159394,"server_id":32,"link":"photo_5266173.html","width":130,"caption":"Mist over Blackmore Vale","height":21});
															thumbnails[5312920] = clik.newPhoto({"id":5312920,"src":"abstract_two_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_5312920.html","width":130,"caption":"Abstract two","height":91});
															thumbnails[5394989] = clik.newPhoto({"id":5394989,"src":"abstract_fiveclik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_5394989.html","width":130,"caption":"Abstract five","height":86});
															thumbnails[5395000] = clik.newPhoto({"id":5395000,"src":"abstract_sixclik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_5395000.html","width":130,"caption":"Abstract six","height":86});
															thumbnails[5395005] = clik.newPhoto({"id":5395005,"src":"eye_of_the_worldclik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_5395005.html","width":130,"caption":"Eye of the world","height":86});
															thumbnails[5395011] = clik.newPhoto({"id":5395011,"src":"garlic_fractalclik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_5395011.html","width":130,"caption":"Garlic fractal","height":90});
															thumbnails[5453322] = clik.newPhoto({"id":5453322,"src":"flight_of_the_seabirds_1clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_5453322.html","width":130,"caption":"Flight of the seabirds","height":93});
															thumbnails[5574179] = clik.newPhoto({"id":5574179,"src":"Something_darkclik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_5574179.html","width":130,"caption":"Something dark","height":86});
															thumbnails[6091185] = clik.newPhoto({"id":6091185,"src":"Dittisham_dawn_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_6091185.html","width":130,"caption":"Dittisham at dawn","height":86});
															thumbnails[6092550] = clik.newPhoto({"id":6092550,"src":"_NLM0220gorilla_four_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_6092550.html","width":130,"caption":"Male gorilla","height":86});
															thumbnails[6092554] = clik.newPhoto({"id":6092554,"src":"Tiny_dancer_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_6092554.html","width":130,"caption":"Tiny dancer","height":86});
															thumbnails[6256336] = clik.newPhoto({"id":6256336,"src":"_NLM0167_clematis_clik_thumb.jpg","galleries_id":159640,"server_id":32,"link":"photo_6256336.html","width":130,"caption":"Blue clematis flower ","height":86});
															thumbnails[6256385] = clik.newPhoto({"id":6256385,"src":"_NLM0024red_panda_hiding_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_6256385.html","width":130,"caption":"Red panda hiding","height":82});
															thumbnails[6256388] = clik.newPhoto({"id":6256388,"src":"_NLM0044two_orangs_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_6256388.html","width":130,"caption":"Wot you got?","height":93});
															thumbnails[6256395] = clik.newPhoto({"id":6256395,"src":"_NLM0188Orang_three_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_6256395.html","width":130,"caption":"Orangutan","height":86});
															thumbnails[6256399] = clik.newPhoto({"id":6256399,"src":"Cheetah_one_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_6256399.html","width":130,"caption":"Cheetah","height":87});
															thumbnails[6256401] = clik.newPhoto({"id":6256401,"src":"wolves_one_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_6256401.html","width":130,"caption":"Wolves","height":87});
															thumbnails[6256423] = clik.newPhoto({"id":6256423,"src":"_NLM0160cheetah_one_plus_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_6256423.html","width":130,"caption":"Cheetah","height":86});
															thumbnails[6256425] = clik.newPhoto({"id":6256425,"src":"_NLM0157tiger_one_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_6256425.html","width":130,"caption":"Tiger","height":86});
															thumbnails[6662680] = clik.newPhoto({"id":6662680,"src":"watersideapartments_solarised_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_6662680.html","width":130,"caption":"Solarised waterside appartments","height":86});
															thumbnails[6662683] = clik.newPhoto({"id":6662683,"src":"Something_dark_green_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_6662683.html","width":130,"caption":"Something dark green","height":86});
															thumbnails[6662686] = clik.newPhoto({"id":6662686,"src":"Something_dark_cyan_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_6662686.html","width":130,"caption":"Something dark cyan","height":86});
															thumbnails[6662689] = clik.newPhoto({"id":6662689,"src":"fractal_Zebra2_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_6662689.html","width":98,"caption":"Fractal Zebra 2","height":130});
															thumbnails[7340787] = clik.newPhoto({"id":7340787,"src":"shell_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_7340787.html","width":130,"caption":"Sea Shell","height":87});
															thumbnails[7504702] = clik.newPhoto({"id":7504702,"src":"The_Nautilus_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_7504702.html","width":130,"caption":"The Nautilus","height":98});
															thumbnails[7504710] = clik.newPhoto({"id":7504710,"src":"_NLM0023_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_7504710.html","width":130,"caption":"seashell in blue","height":86});
															thumbnails[7504736] = clik.newPhoto({"id":7504736,"src":"autumn_over_dainton_golfcourse_clik_thumb.jpg","galleries_id":159394,"server_id":32,"link":"photo_7504736.html","width":130,"caption":"Autumn over Dainton Golf Course","height":25});
															thumbnails[7573379] = clik.newPhoto({"id":7573379,"src":"golden_eagle_clik_thumb.jpg","galleries_id":159639,"server_id":32,"link":"photo_7573379.html","width":93,"caption":"Golden Eagle","height":130});
															thumbnails[7573384] = clik.newPhoto({"id":7573384,"src":"point_to_point_1_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_7573384.html","width":130,"caption":"over the jumps","height":89});
															thumbnails[7573385] = clik.newPhoto({"id":7573385,"src":"point_to_point_2_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_7573385.html","width":130,"caption":"taking the fence","height":90});
															thumbnails[7573386] = clik.newPhoto({"id":7573386,"src":"point_to_point_3_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_7573386.html","width":130,"caption":"coming last","height":81});
															thumbnails[7614559] = clik.newPhoto({"id":7614559,"src":"A_bend_in_the_river_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_7614559.html","width":130,"caption":"A bend in the river","height":86});
															thumbnails[7869631] = clik.newPhoto({"id":7869631,"src":"abstract_two_greens_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_7869631.html","width":130,"caption":"Green Abstract two","height":91});
															thumbnails[7869648] = clik.newPhoto({"id":7869648,"src":"fractal_clematis_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_7869648.html","width":130,"caption":"Fractal Clematis","height":86});
															thumbnails[8108924] = clik.newPhoto({"id":8108924,"src":"Brushford_church_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_8108924.html","width":130,"caption":"Brushford Church Interior","height":85});
															thumbnails[8403353] = clik.newPhoto({"id":8403353,"src":"belly_dance_2_fractal_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_8403353.html","width":130,"caption":"Belly dancers","height":85});
															thumbnails[8403359] = clik.newPhoto({"id":8403359,"src":"2_shires_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_8403359.html","width":130,"caption":"Two Shires","height":91});
															thumbnails[8403388] = clik.newPhoto({"id":8403388,"src":"3_horse_combi_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_8403388.html","width":130,"caption":"3 horse combi","height":91});
															thumbnails[8403390] = clik.newPhoto({"id":8403390,"src":"bw_3_horse_combine_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_8403390.html","width":86,"caption":"Old-fashioned style pics of harvesting","height":130});
															thumbnails[8403391] = clik.newPhoto({"id":8403391,"src":"line_of_stooks_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_8403391.html","width":86,"caption":"Line of Stooks","height":130});
															thumbnails[8403394] = clik.newPhoto({"id":8403394,"src":"Vardu_2_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_8403394.html","width":86,"caption":"Gypsy vardo","height":130});
															thumbnails[8440980] = clik.newPhoto({"id":8440980,"src":"The_ghosts_of_snowdrops_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_8440980.html","width":130,"caption":"The Ghosts of Snowdrops","height":92});
															thumbnails[8685481] = clik.newPhoto({"id":8685481,"src":"_nautilus_in_blue_clik_thumb.jpg","galleries_id":159642,"server_id":32,"link":"photo_8685481.html","width":130,"caption":"Nautilus in blue","height":86});
															thumbnails[8901469] = clik.newPhoto({"id":8901469,"src":"The_midnight_tiger_clik_thumb.jpg","galleries_id":308195,"server_id":32,"link":"photo_8901469.html","width":130,"caption":"The Midnight Tiger","height":86});
															thumbnails[8955243] = clik.newPhoto({"id":8955243,"src":"Lone_wolf_clik_thumb.jpg","galleries_id":159641,"server_id":32,"link":"photo_8955243.html","width":130,"caption":"Lone Wolf","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[159639] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Birds","link":"gallery_159639.html","maxRecords":0.0,"photoIDs":[2487499.0,2487502.0,2487508.0,2487513.0,3579120.0,3874206.0,4547390.0,7573379.0],"skipIndex":0,"section_code":"gallery","featured_images":"7573379,4547390,3874206,3579120,2487513,2487508,2487502,2487499","id":159639,"singleSection":false});				  						galleries[159640] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Flowers","link":"gallery_159640.html","maxRecords":0.0,"photoIDs":[2491384.0,2491389.0,2491390.0,2495701.0,2495718.0,2495748.0,4857981.0,4857987.0,6256336.0],"skipIndex":0,"section_code":"gallery","featured_images":"6256336,4857987,4857981,2495748,2495718,2495701,2491390,2491389,2491384","id":159640,"singleSection":false});				  						galleries[308195] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Fractal photos","link":"gallery_308195.html","maxRecords":0.0,"photoIDs":[5312920.0,5394989.0,5395000.0,5395005.0,5395011.0,5453322.0,5574179.0,6092554.0,6662683.0,6662686.0,6662689.0,7869631.0,7869648.0,8403353.0,8440980.0,8901469.0],"skipIndex":0,"section_code":"gallery","featured_images":"8901469,8440980,8403353,7869648,7869631,6662689,6662686,6662683,6092554,5574179","id":308195,"singleSection":false});				  						galleries[159642] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Miscellaneous","link":"gallery_159642.html","maxRecords":0.0,"photoIDs":[2491391.0,2491395.0,2491399.0,5122806.0,6091185.0,6662680.0,7340787.0,7504702.0,7504710.0,7573384.0,7573385.0,7573386.0,7614559.0,8108924.0,8403359.0,8403388.0,8403390.0,8403391.0,8403394.0,8685481.0],"skipIndex":0,"section_code":"gallery","featured_images":"8685481,8403394,8403391,8403390,8403388,8403359,8108924,7614559,7573386,7573385","id":159642,"singleSection":false});				  						galleries[159641] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife","link":"gallery_159641.html","maxRecords":0.0,"photoIDs":[2487603.0,2487605.0,3517755.0,3620936.0,4410809.0,4410816.0,4410824.0,4410828.0,4410835.0,4999851.0,6092550.0,6256385.0,6256388.0,6256395.0,6256399.0,6256401.0,6256423.0,6256425.0,8955243.0],"skipIndex":0,"section_code":"gallery","featured_images":"8955243,6256425,6256423,6256401,6256399,6256395,6256388,6256385,6092550,4999851","id":159641,"singleSection":false});				  						galleries[159393] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Framed photos","link":"gallery_159393.html","maxRecords":0.0,"photoIDs":[3324658.0,3324662.0,3324663.0,3324664.0],"skipIndex":0,"section_code":"gallery","featured_images":"3324664,3324663,3324662,3324658","id":159393,"singleSection":false});				  						galleries[159394] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"New attempts!","link":"gallery_159394.html","maxRecords":0.0,"photoIDs":[4230885.0,5266173.0,7504736.0],"skipIndex":0,"section_code":"gallery","featured_images":"7504736,5266173,4230885","id":159394,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8955243,8440980,8403353,7869648,7869631,7614559,7573384,6662686,5312920';
imageSets[3] = '8955243,8901469,8685481,8440980,8403394,8403391,8403390,8403388,8403359,8403353,8108924,7869648,7869631,7614559,7573386,7573385,7573384,7573379,7504736,7504710,7504702,7340787,6662689,6662686,6662683,6662680,6256425,6256423,6256401,6256399,6256395,6256388,6256385,6256336,6092554,6092550,6091185,5574179,5453322,5395011,5395005,5395000,5394989,5312920,5266173,5122806,4999851,4857987,4857981,4547390';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/fisher/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/fisher/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/fisher/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/fisher/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/fisher/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/fisher/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/fisher/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/fisher/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 = 'Trevor Ashford 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>';
	}
				
	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="trevor@tda1.wanadoo.co.uk">';
					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="trevor@tda1.wanadoo.co.uk">';
				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({					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;
	}
}

			

