window.thumbnails = {};
															thumbnails[8660672] = clik.newPhoto({"id":8660672,"src":"combi_C_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":160,"caption":"","height":117});
															thumbnails[8967645] = clik.newPhoto({"id":8967645,"src":"Blackberries_130_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":160,"caption":"","height":113});
															thumbnails[5741691] = clik.newPhoto({"id":5741691,"src":"SD_port0712_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":97,"caption":"","height":130});
															thumbnails[1238525] = clik.newPhoto({"id":1238525,"src":"Voyager 1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":100,"caption":"","height":130});
															thumbnails[2993999] = clik.newPhoto({"id":2993999,"src":"all_bks600pix_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"A selection of Stephen's Books","height":78});
															thumbnails[4077660] = clik.newPhoto({"id":4077660,"src":"966_orb_web2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":90,"caption":"","height":130});
															thumbnails[4077846] = clik.newPhoto({"id":4077846,"src":"968_wasp_spid_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":87,"caption":"","height":130});
															thumbnails[4079644] = clik.newPhoto({"id":4079644,"src":"969_green_spid_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":89,"caption":"","height":130});
															thumbnails[4079742] = clik.newPhoto({"id":4079742,"src":"965_spid_books_2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"SPIDERS The Ultimate Predators","height":82});
															thumbnails[4079816] = clik.newPhoto({"id":4079816,"src":"970_ladybird_spid_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":88});
															thumbnails[4080481] = clik.newPhoto({"id":4080481,"src":"spider_book_page112345_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":42});
															thumbnails[4106457] = clik.newPhoto({"id":4106457,"src":"971_all_books_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":82});
															thumbnails[5029222] = clik.newPhoto({"id":5029222,"src":"sailfin_exhib_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":96,"caption":"","height":130});
															thumbnails[8777356] = clik.newPhoto({"id":8777356,"src":"209_wasp_apple_b_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_8777356.html","width":107,"caption":"Common Wasp","height":160});
															thumbnails[4034654] = clik.newPhoto({"id":4034654,"src":"955_owl_rat_thumb_733EDE64-1EC9-D45B-1CDF9BC5D6ABC460.jpg","galleries_id":87321,"server_id":1,"link":"photo_4034654.html","width":149,"caption":"BARN OWL and RAT","height":180});
															thumbnails[4045177] = clik.newPhoto({"id":4045177,"src":"956_hummer_bath_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_4045177.html","width":105,"caption":" HUMMINGBIRD BATHING","height":130});
															thumbnails[4058803] = clik.newPhoto({"id":4058803,"src":"954_robin_spade_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_4058803.html","width":90,"caption":"EXPECTANT ROBIN","height":130});
															thumbnails[1235867] = clik.newPhoto({"id":1235867,"src":"035_swallow_drink_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1235867.html","width":130,"caption":"SWALLOW DRINKING","height":93});
															thumbnails[1235868] = clik.newPhoto({"id":1235868,"src":"171_ robin_sing_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1235868.html","width":130,"caption":"ROBIN SINGING","height":89});
															thumbnails[1235883] = clik.newPhoto({"id":1235883,"src":"225_tawny_owl_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1235883.html","width":130,"caption":"TAWNY OWL","height":93});
															thumbnails[1235885] = clik.newPhoto({"id":1235885,"src":"543_barn_owl_gallops_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1235885.html","width":130,"caption":"BARN OWL","height":128});
															thumbnails[1233587] = clik.newPhoto({"id":1233587,"src":"073_kingfisher_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1233587.html","width":111,"caption":"KINGFISHER","height":130});
															thumbnails[1233588] = clik.newPhoto({"id":1233588,"src":"248_kestrel_m6_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1233588.html","width":130,"caption":"KESTREL in FLIGHT","height":39});
															thumbnails[1233601] = clik.newPhoto({"id":1233601,"src":"269_blue_tit_m6_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1233601.html","width":130,"caption":"BLUE TIT LANDING","height":51});
															thumbnails[1233622] = clik.newPhoto({"id":1233622,"src":"285_sparrow_hk_circ_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1233622.html","width":108,"caption":"SPARROW HAWK","height":130});
															thumbnails[1233624] = clik.newPhoto({"id":1233624,"src":"297_robin_clo_line_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1233624.html","width":130,"caption":"ROBIN","height":94});
															thumbnails[1233628] = clik.newPhoto({"id":1233628,"src":"458_barn_ owl_m6_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1233628.html","width":130,"caption":"BARN OWL","height":39});
															thumbnails[1233635] = clik.newPhoto({"id":1233635,"src":"524_swallow_shed_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1233635.html","width":129,"caption":"SWALLOW LEAVING BARN","height":130});
															thumbnails[1227265] = clik.newPhoto({"id":1227265,"src":"022_barn_owl_fel_thumb.jpg","galleries_id":87321,"server_id":1,"link":"photo_1227265.html","width":89,"caption":"Barn Owl","height":130});
															thumbnails[1240795] = clik.newPhoto({"id":1240795,"src":"236_red_admiral_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1240795.html","width":130,"caption":"Red Admiral","height":96});
															thumbnails[1240797] = clik.newPhoto({"id":1240797,"src":"272_green_helicon_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1240797.html","width":130,"caption":"Green Heliconid","height":89});
															thumbnails[1240801] = clik.newPhoto({"id":1240801,"src":"358_lacewing_m3_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1240801.html","width":107,"caption":"Green Lacewingfly takeing off","height":130});
															thumbnails[1243150] = clik.newPhoto({"id":1243150,"src":"096_bumble_blubell_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1243150.html","width":130,"caption":"Carder Bumblebee","height":86});
															thumbnails[1243157] = clik.newPhoto({"id":1243157,"src":"226_honeybee_crocus_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1243157.html","width":95,"caption":"Honey Bee ","height":130});
															thumbnails[1243169] = clik.newPhoto({"id":1243169,"src":"239_rhod_leafhop_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1243169.html","width":91,"caption":"Leafhopper","height":130});
															thumbnails[1243173] = clik.newPhoto({"id":1243173,"src":"335_common_darter_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1243173.html","width":130,"caption":"Common Darter","height":93});
															thumbnails[1243176] = clik.newPhoto({"id":1243176,"src":"342_emerald_damselfly_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1243176.html","width":130,"caption":"Emerald Damselfly","height":92});
															thumbnails[1249714] = clik.newPhoto({"id":1249714,"src":"191_ladybird_ take-off_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1249714.html","width":94,"caption":"Ladybird take-off","height":130});
															thumbnails[1249720] = clik.newPhoto({"id":1249720,"src":"331_hawk_dragonfly_eglad_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1249720.html","width":130,"caption":"Hawker dragonfly","height":91});
															thumbnails[1250483] = clik.newPhoto({"id":1250483,"src":"708_morpho1_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1250483.html","width":130,"caption":"Morpho","height":86});
															thumbnails[1252988] = clik.newPhoto({"id":1252988,"src":"111_plexippus_ x3b_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1252988.html","width":130,"caption":"Jumping Spider","height":41});
															thumbnails[1240809] = clik.newPhoto({"id":1240809,"src":"271_monarch_blu_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1240809.html","width":130,"caption":"Monarch","height":90});
															thumbnails[1235865] = clik.newPhoto({"id":1235865,"src":"017_carder_bee_bals1_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_1235865.html","width":130,"caption":"Carder Bumblebee","height":96});
															thumbnails[4863764] = clik.newPhoto({"id":4863764,"src":"972_Grasshop_take-off_M3_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_4863764.html","width":105,"caption":"MEADOW GRASSHOPPER","height":130});
															thumbnails[4050225] = clik.newPhoto({"id":4050225,"src":"960_fence_spider_combi_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_4050225.html","width":130,"caption":"FENCE SPIDER LEAPING","height":30});
															thumbnails[4050425] = clik.newPhoto({"id":4050425,"src":"961_fruit__fly_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_4050425.html","width":130,"caption":"FRUIT FLY over BANANAS","height":88});
															thumbnails[4050473] = clik.newPhoto({"id":4050473,"src":"962_dronefly_takeoff_thumb.jpg","galleries_id":87323,"server_id":1,"link":"photo_4050473.html","width":130,"caption":"DRONE FLY","height":87});
															thumbnails[1240863] = clik.newPhoto({"id":1240863,"src":"562_badger_ path_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1240863.html","width":107,"caption":"Badger","height":130});
															thumbnails[1236548] = clik.newPhoto({"id":1236548,"src":"448_fox_dustbin_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1236548.html","width":130,"caption":"Red Fox","height":93});
															thumbnails[1236577] = clik.newPhoto({"id":1236577,"src":"598_dormouse_berri_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1236577.html","width":88,"caption":"Dormouse","height":130});
															thumbnails[1236582] = clik.newPhoto({"id":1236582,"src":"594_dormouse_leap_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1236582.html","width":111,"caption":"Leaping Dormouse","height":130});
															thumbnails[1240804] = clik.newPhoto({"id":1240804,"src":"535_hedghog_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1240804.html","width":108,"caption":"Hedgehog","height":130});
															thumbnails[1227253] = clik.newPhoto({"id":1227253,"src":"002_bushbaby_cu_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1227253.html","width":130,"caption":"Bushbaby portrait","height":88});
															thumbnails[1236390] = clik.newPhoto({"id":1236390,"src":"001_bushbab_ M6_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1236390.html","width":130,"caption":"LEAPING BUSHBABY","height":36});
															thumbnails[1236464] = clik.newPhoto({"id":1236464,"src":"284_yellow_neck_mou_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1236464.html","width":130,"caption":"Yellow-necked mouse","height":86});
															thumbnails[1236476] = clik.newPhoto({"id":1236476,"src":"133_water_shrew_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1236476.html","width":130,"caption":"Water Shrew","height":94});
															thumbnails[1236510] = clik.newPhoto({"id":1236510,"src":"159_daubenton_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1236510.html","width":108,"caption":"Daubenton's Bat","height":130});
															thumbnails[1236528] = clik.newPhoto({"id":1236528,"src":"219_water_ vole_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1236528.html","width":130,"caption":"WATER VOLE","height":96});
															thumbnails[1235748] = clik.newPhoto({"id":1235748,"src":"135_rat_bin_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1235748.html","width":130,"caption":"BROWN RAT LEAPING","height":85});
															thumbnails[1233639] = clik.newPhoto({"id":1233639,"src":"546_ house_ mouse_stab_thumb.jpg","galleries_id":87322,"server_id":1,"link":"photo_1233639.html","width":96,"caption":"HOUSE MOUSE","height":130});
															thumbnails[1235738] = clik.newPhoto({"id":1235738,"src":"017_ archer_fish_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1235738.html","width":98,"caption":"Archer Fish","height":130});
															thumbnails[1235745] = clik.newPhoto({"id":1235745,"src":"045_basilisk_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1235745.html","width":130,"caption":"BROWN BASILISK ","height":102});
															thumbnails[1235793] = clik.newPhoto({"id":1235793,"src":"440_green_cat_snake_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1235793.html","width":90,"caption":"Green Cat Snake","height":130});
															thumbnails[1235796] = clik.newPhoto({"id":1235796,"src":"444_puff_adder_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1235796.html","width":99,"caption":"Puff Adder","height":130});
															thumbnails[1235806] = clik.newPhoto({"id":1235806,"src":"913_marsh_frog1_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1235806.html","width":130,"caption":"Marsh Frog","height":101});
															thumbnails[1235822] = clik.newPhoto({"id":1235822,"src":"930_veiled_chamel_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1235822.html","width":87,"caption":"VEILED CHAMELEON","height":130});
															thumbnails[1230104] = clik.newPhoto({"id":1230104,"src":"003_wallace_fly_frog_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1230104.html","width":113,"caption":"Wallace's Flying Frog","height":130});
															thumbnails[1230122] = clik.newPhoto({"id":1230122,"src":"019_sailfin_dragon_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1230122.html","width":98,"caption":"Giant Sailfin Dragon","height":130});
															thumbnails[1230215] = clik.newPhoto({"id":1230215,"src":"339_tree_frog_sit_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1230215.html","width":130,"caption":"Red-eyed Tree Frog","height":90});
															thumbnails[1230229] = clik.newPhoto({"id":1230229,"src":"703_leop_frog_leap_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1230229.html","width":106,"caption":"Leopard Frog leaping","height":130});
															thumbnails[1236540] = clik.newPhoto({"id":1236540,"src":"374_com_frog_duckweed_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1236540.html","width":130,"caption":"Common Frog","height":86});
															thumbnails[1227256] = clik.newPhoto({"id":1227256,"src":"012_ Leop_ frog_div_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1227256.html","width":101,"caption":"Leopard Frog diving","height":130});
															thumbnails[1235879] = clik.newPhoto({"id":1235879,"src":"848_leaf_tail_gecko_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_1235879.html","width":130,"caption":"LEAF-TAILED GECKO","height":89});
															thumbnails[4055373] = clik.newPhoto({"id":4055373,"src":"084_tree_frog_mouth1_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_4055373.html","width":91,"caption":"RED-EYED TREEFROG","height":130});
															thumbnails[4055387] = clik.newPhoto({"id":4055387,"src":"059_tree_frog_ventral_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_4055387.html","width":89,"caption":"RED-EYED TREE FROG","height":130});
															thumbnails[4055576] = clik.newPhoto({"id":4055576,"src":"721_fire_bellied_toad_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_4055576.html","width":85,"caption":"FIRE-BELLIED TOAD","height":130});
															thumbnails[4045216] = clik.newPhoto({"id":4045216,"src":"958_para_gecko_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_4045216.html","width":107,"caption":"PARACHUTE GECKO","height":130});
															thumbnails[4045239] = clik.newPhoto({"id":4045239,"src":"959__drako_thumb.jpg","galleries_id":87320,"server_id":1,"link":"photo_4045239.html","width":105,"caption":"FLYING LIZARD","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[87321] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"BIRDS","link":"gallery_87321.html","maxRecords":0.0,"photoIDs":[4034654.0,4045177.0,4058803.0,1235867.0,1235868.0,1235883.0,1235885.0,1233587.0,1233588.0,1233601.0,1233622.0,1233624.0,1233628.0,1233635.0,1227265.0],"skipIndex":0,"section_code":"gallery","featured_images":"4058803,4045177,4034654,1235885,1235883,1235868,1235867,1233635,1233628,1233624","id":87321,"singleSection":false});				  						galleries[87323] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"INSECTS & OTHERS","link":"gallery_87323.html","maxRecords":0.0,"photoIDs":[8777356.0,1240795.0,1240797.0,1240801.0,1243150.0,1243157.0,1243169.0,1243173.0,1243176.0,1249714.0,1249720.0,1250483.0,1252988.0,1240809.0,1235865.0,4863764.0,4050225.0,4050425.0,4050473.0],"skipIndex":0,"section_code":"gallery","featured_images":"8777356,4863764,4050473,4050425,4050225,1252988,1250483,1249720,1249714,1243176","id":87323,"singleSection":false});				  						galleries[87322] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"MAMMALS","link":"gallery_87322.html","maxRecords":0.0,"photoIDs":[1240863.0,1236548.0,1236577.0,1236582.0,1240804.0,1227253.0,1236390.0,1236464.0,1236476.0,1236510.0,1236528.0,1235748.0,1233639.0],"skipIndex":0,"section_code":"gallery","featured_images":"1240863,1240804,1236582,1236577,1236548,1236528,1236510,1236476,1236464,1236390","id":87322,"singleSection":false});				  						galleries[87320] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"REPTILES, AMPHIBIANS etc","link":"gallery_87320.html","maxRecords":0.0,"photoIDs":[1235738.0,1235745.0,1235793.0,1235796.0,1235806.0,1235822.0,1230104.0,1230122.0,1230215.0,1230229.0,1236540.0,1227256.0,1235879.0,4055373.0,4055387.0,4055576.0,4045216.0,4045239.0],"skipIndex":0,"section_code":"gallery","featured_images":"4055576,4055387,4055373,4045239,4045216,1236540,1235879,1235822,1235806,1235796","id":87320,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '4034654,4045177,4058803,1235867,1235868,1235885,1233587,1233588,1233601,1233622,1233628,1227265,1240795,1240797,1240801,1243150,1243157,1243169,1243173,1243176,1249714,1249720,1250483,1252988,1240809,1235865,4050225,1240863,1236548,1236577,1236582,1240804,1227253,1236476,1236510,1236528,1235748,1233639,1235738,1235745,1235793,1235796,1235806,1235822,1230104,1230122,1230229,1236540,1227256,1235879,4055373,4055387,4055576,4045216,4045239';
imageSets[3] = '5741691,1238525,2993999,4077660,4077846,4079644,4079742,4079816,4106457,4058803,1240795,1240797,1240801,1243150,1243157,1243169,1243173,1243176,1249720,1252988,4863764,4050225,1236528,1236540,4055373,4055387';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/stephendalton/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/stephendalton/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 = 'Stephen Dalton Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

