window.thumbnails = {};
															thumbnails[5121014] = clik.newPhoto({"id":5121014,"src":"ceiling_thumb.jpg","galleries_id":289359,"server_id":5,"link":"photo_5121014.html","width":130,"caption":"Ceiling Detail","height":104});
															thumbnails[5121045] = clik.newPhoto({"id":5121045,"src":"which_way_now1_thumb.jpg","galleries_id":289359,"server_id":5,"link":"photo_5121045.html","width":130,"caption":"Which way now?","height":80});
															thumbnails[5121077] = clik.newPhoto({"id":5121077,"src":"fudge_thumb.jpg","galleries_id":289359,"server_id":5,"link":"photo_5121077.html","width":130,"caption":"Fudge","height":129});
															thumbnails[5206939] = clik.newPhoto({"id":5206939,"src":"Climber_thumb.jpg","galleries_id":293925,"server_id":5,"link":"photo_5206939.html","width":130,"caption":"Climber","height":104});
															thumbnails[5206943] = clik.newPhoto({"id":5206943,"src":"Deadsign_thumb.jpg","galleries_id":293925,"server_id":5,"link":"photo_5206943.html","width":130,"caption":"Dead Sign","height":104});
															thumbnails[5206944] = clik.newPhoto({"id":5206944,"src":"Nun1_thumb.jpg","galleries_id":293925,"server_id":5,"link":"photo_5206944.html","width":130,"caption":"Nun","height":104});
															thumbnails[5206946] = clik.newPhoto({"id":5206946,"src":"SeaCoal1_thumb.jpg","galleries_id":293925,"server_id":5,"link":"photo_5206946.html","width":130,"caption":"Sea Coal","height":104});
															thumbnails[5616161] = clik.newPhoto({"id":5616161,"src":"Warholesque_minis_thumb.jpg","galleries_id":289359,"server_id":5,"link":"photo_5616161.html","width":130,"caption":"Warholesque Minis","height":98});
															thumbnails[5616197] = clik.newPhoto({"id":5616197,"src":"Lonely_Heart_thumb.jpg","galleries_id":289359,"server_id":5,"link":"photo_5616197.html","width":130,"caption":"Lonely Heart","height":86});
															thumbnails[5616198] = clik.newPhoto({"id":5616198,"src":"Water_Bottle_thumb.jpg","galleries_id":289359,"server_id":5,"link":"photo_5616198.html","width":130,"caption":"Water Bottle - lit up","height":195});
															thumbnails[6689762] = clik.newPhoto({"id":6689762,"src":"David_U_-_Acer_thumb.JPG","galleries_id":365278,"server_id":5,"link":"photo_6689762.html","width":130,"caption":"Acer","height":130});
															thumbnails[6689769] = clik.newPhoto({"id":6689769,"src":"David_U_-_Autumn_leaves_2_thumb.JPG","galleries_id":365278,"server_id":5,"link":"photo_6689769.html","width":130,"caption":"Autumn Leaves","height":104});
															thumbnails[6689771] = clik.newPhoto({"id":6689771,"src":"David_U_-_St_Marks_square_thumb.JPG","galleries_id":365278,"server_id":5,"link":"photo_6689771.html","width":130,"caption":"St Mark's Square","height":163});
															thumbnails[6689775] = clik.newPhoto({"id":6689775,"src":"David_U_-_Venetian_Mask_thumb.JPG","galleries_id":365278,"server_id":5,"link":"photo_6689775.html","width":130,"caption":"Venetian Mask","height":130});
															thumbnails[6689780] = clik.newPhoto({"id":6689780,"src":"David_U_-_Venice_thumb.JPG","galleries_id":365278,"server_id":5,"link":"photo_6689780.html","width":130,"caption":"Venice","height":163});
															thumbnails[6689784] = clik.newPhoto({"id":6689784,"src":"David_U_-_Wicket_down_thumb.JPG","galleries_id":365278,"server_id":5,"link":"photo_6689784.html","width":130,"caption":"Wicket Down!","height":65});
															thumbnails[6752219] = clik.newPhoto({"id":6752219,"src":"Paul_B_-_The_sage_thumb.jpg","galleries_id":362536,"server_id":5,"link":"photo_6752219.html","width":130,"caption":"The Sage","height":195});
															thumbnails[7039538] = clik.newPhoto({"id":7039538,"src":"Keith_Wagner_Bumper_Cars_thumb.jpg","galleries_id":381138,"server_id":5,"link":"photo_7039538.html","width":130,"caption":"Bumper Cars","height":183});
															thumbnails[7039563] = clik.newPhoto({"id":7039563,"src":"Keith_Wagner_Stag_thumb.jpg","galleries_id":381138,"server_id":5,"link":"photo_7039563.html","width":130,"caption":"Stag","height":109});
															thumbnails[7039566] = clik.newPhoto({"id":7039566,"src":"Keith_Wagner_Two_of_a_kind_thumb.jpg","galleries_id":381138,"server_id":5,"link":"photo_7039566.html","width":130,"caption":"Two of a kind","height":87});
															thumbnails[7581560] = clik.newPhoto({"id":7581560,"src":"Red_Admiral_thumb.jpg","galleries_id":411231,"server_id":5,"link":"photo_7581560.html","width":130,"caption":"Red Admiral","height":98});
															thumbnails[7581561] = clik.newPhoto({"id":7581561,"src":"River_Mite_at_Ravenglass_Station_thumb.jpg","galleries_id":411231,"server_id":5,"link":"photo_7581561.html","width":130,"caption":"River Mite at Ravenglass Station","height":98});
															thumbnails[7581563] = clik.newPhoto({"id":7581563,"src":"Sunset_over_the_Summer_Isles_thumb.jpg","galleries_id":411231,"server_id":5,"link":"photo_7581563.html","width":130,"caption":"Sunset over the Summer Isles","height":98});
															thumbnails[7581564] = clik.newPhoto({"id":7581564,"src":"Sunset_Oban_Bay_thumb.jpg","galleries_id":411231,"server_id":5,"link":"photo_7581564.html","width":130,"caption":"Sunset, Oban Bay","height":98});
															thumbnails[7581566] = clik.newPhoto({"id":7581566,"src":"The_glory_of_steam_thumb.jpg","galleries_id":411231,"server_id":5,"link":"photo_7581566.html","width":130,"caption":"The Glory of Steam","height":98});
															thumbnails[8530646] = clik.newPhoto({"id":8530646,"src":"Christmas_Day_thumb.jpg","galleries_id":381138,"server_id":5,"link":"photo_8530646.html","width":130,"caption":"Christmas Day","height":92});
															thumbnails[8571603] = clik.newPhoto({"id":8571603,"src":"1317815524_resized_thumb.jpg","galleries_id":320376,"server_id":5,"link":"photo_8571603.html","width":130,"caption":"Poppies","height":163});
															thumbnails[8571609] = clik.newPhoto({"id":8571609,"src":"1317815532_resized_thumb.jpg","galleries_id":320376,"server_id":5,"link":"photo_8571609.html","width":130,"caption":"","height":130});
															thumbnails[8571640] = clik.newPhoto({"id":8571640,"src":"1317815539_resized_thumb.jpg","galleries_id":320376,"server_id":5,"link":"photo_8571640.html","width":130,"caption":"Trampolining","height":130});
															thumbnails[8571644] = clik.newPhoto({"id":8571644,"src":"1317819485_resized_thumb.jpg","galleries_id":320376,"server_id":5,"link":"photo_8571644.html","width":130,"caption":"","height":108});
															thumbnails[8571645] = clik.newPhoto({"id":8571645,"src":"1317819496_resized_thumb.jpg","galleries_id":320376,"server_id":5,"link":"photo_8571645.html","width":130,"caption":"Peacock feather","height":87});
															thumbnails[8571663] = clik.newPhoto({"id":8571663,"src":"1317819500_resized_thumb.jpg","galleries_id":320376,"server_id":5,"link":"photo_8571663.html","width":130,"caption":"Tulips","height":87});
															thumbnails[5104650] = clik.newPhoto({"id":5104650,"src":"travel8_thumb.jpg","galleries_id":288539,"server_id":5,"link":"photo_5104650.html","width":130,"caption":"Incense burning at the Man Mo Temple New Territories Hong Kong","height":73});
															thumbnails[5104668] = clik.newPhoto({"id":5104668,"src":"wildlife6_thumb.jpg","galleries_id":288539,"server_id":5,"link":"photo_5104668.html","width":130,"caption":"Galapagos Sealions","height":195});
															thumbnails[7581557] = clik.newPhoto({"id":7581557,"src":"Aysgarth_Falls_thumb.jpg","galleries_id":411231,"server_id":5,"link":"photo_7581557.html","width":130,"caption":"Aysgarth Falls","height":98});
															thumbnails[8525550] = clik.newPhoto({"id":8525550,"src":"Osteospurnum_flower_thumb.jpg","galleries_id":450585,"server_id":5,"link":"photo_8525550.html","width":130,"caption":"Osteospurnum","height":87});
															thumbnails[8525612] = clik.newPhoto({"id":8525612,"src":"tree_and_limestone_thumb.jpg","galleries_id":450584,"server_id":5,"link":"photo_8525612.html","width":130,"caption":"Tree and Limestone","height":98});
															thumbnails[8525747] = clik.newPhoto({"id":8525747,"src":"123_-_Dawn_Norway_-_Keith_Wagner_thumb.jpg","galleries_id":381138,"server_id":5,"link":"photo_8525747.html","width":130,"caption":"Dawn - Norway","height":98});
															thumbnails[8525790] = clik.newPhoto({"id":8525790,"src":"Feb09snow_in_the_dales_178-1_thumb.jpg","galleries_id":450583,"server_id":5,"link":"photo_8525790.html","width":130,"caption":"Snow in the Dales","height":91});
															thumbnails[9080358] = clik.newPhoto({"id":9080358,"src":"Neil_Lucas_poster_thumb.jpg","galleries_id":289359,"server_id":5,"link":"photo_9080358.html","width":130,"caption":"Neil Lucas Advert","height":104});
															thumbnails[5104653] = clik.newPhoto({"id":5104653,"src":"travel5_thumb.jpg","galleries_id":288539,"server_id":5,"link":"photo_5104653.html","width":130,"caption":"Masai Sunset","height":73});
															thumbnails[8525553] = clik.newPhoto({"id":8525553,"src":"barnowl_on_wheel_barrow_thumb.jpg","galleries_id":450585,"server_id":5,"link":"photo_8525553.html","width":130,"caption":"Barn Owl on Wheelbarrow","height":83});
															thumbnails[8525617] = clik.newPhoto({"id":8525617,"src":"rope_thumb.jpg","galleries_id":450584,"server_id":5,"link":"photo_8525617.html","width":130,"caption":"Rope","height":98});
															thumbnails[8525816] = clik.newPhoto({"id":8525816,"src":"April09_379a_2_thumb.jpg","galleries_id":450583,"server_id":5,"link":"photo_8525816.html","width":130,"caption":"","height":195});
															thumbnails[5110347] = clik.newPhoto({"id":5110347,"src":"0911_wildlife2_thumb.jpg","galleries_id":288539,"server_id":5,"link":"photo_5110347.html","width":130,"caption":"Cheetah family in the Masai Mara","height":195});
															thumbnails[5110651] = clik.newPhoto({"id":5110651,"src":"0911_Namib_Desert3_thumb.jpg","galleries_id":288539,"server_id":5,"link":"photo_5110651.html","width":130,"caption":"Namibia","height":73});
															thumbnails[8525560] = clik.newPhoto({"id":8525560,"src":"10Sleeping_Swan_thumb.jpg","galleries_id":450585,"server_id":5,"link":"photo_8525560.html","width":130,"caption":"Sleeping Swan","height":103});
															thumbnails[8525648] = clik.newPhoto({"id":8525648,"src":"Cloud_and_tree_-_Angie_Willis_thumb.jpg","galleries_id":450584,"server_id":5,"link":"photo_8525648.html","width":130,"caption":"Cloud and Tree","height":98});
															thumbnails[8525819] = clik.newPhoto({"id":8525819,"src":"CambridgeAug2010_313B_thumb.jpg","galleries_id":450583,"server_id":5,"link":"photo_8525819.html","width":130,"caption":"","height":186});
															thumbnails[8525824] = clik.newPhoto({"id":8525824,"src":"ItalySept06_006a_thumb.jpg","galleries_id":450583,"server_id":5,"link":"photo_8525824.html","width":130,"caption":"","height":173});
															thumbnails[8525837] = clik.newPhoto({"id":8525837,"src":"ItalySept06_518b_thumb.jpg","galleries_id":450583,"server_id":5,"link":"photo_8525837.html","width":130,"caption":"","height":108});
															thumbnails[5104644] = clik.newPhoto({"id":5104644,"src":"0911_Golspie_Burn_thumb.jpg","galleries_id":288539,"server_id":5,"link":"photo_5104644.html","width":130,"caption":"Golspie Burn","height":198});
															thumbnails[5206950] = clik.newPhoto({"id":5206950,"src":"Bikejump1_thumb.jpg","galleries_id":293925,"server_id":5,"link":"photo_5206950.html","width":130,"caption":"Bike Jump","height":195});
															thumbnails[8087526] = clik.newPhoto({"id":8087526,"src":"Leeds_Corn_Exchange_thumb.jpg","galleries_id":433054,"server_id":5,"link":"photo_8087526.html","width":130,"caption":"Curves","height":173});
															thumbnails[8087530] = clik.newPhoto({"id":8087530,"src":"Middleham_Gallops_thumb.jpg","galleries_id":433054,"server_id":5,"link":"photo_8087530.html","width":130,"caption":"Middleham Gallops","height":96});
															thumbnails[8087536] = clik.newPhoto({"id":8087536,"src":"Passing_thumb.jpg","galleries_id":433054,"server_id":5,"link":"photo_8087536.html","width":130,"caption":"Passing","height":94});
															thumbnails[8087537] = clik.newPhoto({"id":8087537,"src":"Elephant_Hawk_Moth_thumb.jpg","galleries_id":433054,"server_id":5,"link":"photo_8087537.html","width":130,"caption":"Elephant Hawk-moth","height":98});
															thumbnails[7417740] = clik.newPhoto({"id":7417740,"src":"Six_spot_Burnet2_web_thumb.jpg","galleries_id":288545,"server_id":5,"link":"photo_7417740.html","width":130,"caption":"Six-spot Burnet","height":195});
															thumbnails[8087542] = clik.newPhoto({"id":8087542,"src":"Tyne_reflections_thumb.jpg","galleries_id":433054,"server_id":5,"link":"photo_8087542.html","width":130,"caption":"Tyne Reflections","height":98});
															thumbnails[5135918] = clik.newPhoto({"id":5135918,"src":"3_buds_thumb.jpg","galleries_id":288532,"server_id":5,"link":"photo_5135918.html","width":130,"caption":"3 buds","height":98});
															thumbnails[7417758] = clik.newPhoto({"id":7417758,"src":"Marbled_White_web_thumb.jpg","galleries_id":288545,"server_id":5,"link":"photo_7417758.html","width":130,"caption":"Marbled White","height":87});
															thumbnails[8087111] = clik.newPhoto({"id":8087111,"src":"High_Force_thumb.jpg","galleries_id":433054,"server_id":5,"link":"photo_8087111.html","width":130,"caption":"High Force","height":98});
															thumbnails[7417755] = clik.newPhoto({"id":7417755,"src":"Northern_Marsh_Orchid_web_thumb.jpg","galleries_id":288545,"server_id":5,"link":"photo_7417755.html","width":130,"caption":"Northern Marsh Orchid","height":195});
															thumbnails[5206938] = clik.newPhoto({"id":5206938,"src":"Bonfire1_thumb.jpg","galleries_id":293925,"server_id":5,"link":"photo_5206938.html","width":130,"caption":"Bonfire","height":163});
															thumbnails[7417762] = clik.newPhoto({"id":7417762,"src":"Golden_Plover_web_thumb.jpg","galleries_id":288545,"server_id":5,"link":"photo_7417762.html","width":130,"caption":"Golden Plover","height":87});
															thumbnails[7417774] = clik.newPhoto({"id":7417774,"src":"Dark_red_Helleborine_web_thumb.jpg","galleries_id":288545,"server_id":5,"link":"photo_7417774.html","width":130,"caption":"Dark-red Helleborine","height":195});
															thumbnails[7417769] = clik.newPhoto({"id":7417769,"src":"Four_spotted_Chaser2_web_thumb.jpg","galleries_id":288545,"server_id":5,"link":"photo_7417769.html","width":130,"caption":"Four-spotted Chaser","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[288539] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Andrew Linscott","link":"gallery_288539.html","maxRecords":0.0,"photoIDs":[5104650.0,5104668.0,5104653.0,5110347.0,5110651.0,5104644.0],"skipIndex":0,"section_code":"gallery","featured_images":"5110651,5110347,5104668,5104653,5104650,5104644","id":288539,"singleSection":false});				  						galleries[362536] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Paul Bullock","link":"gallery_362536.html","maxRecords":0.0,"photoIDs":[6752219.0],"skipIndex":0,"section_code":"gallery","featured_images":6752219.0,"id":362536,"singleSection":false});				  						galleries[411231] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Derek Hodson","link":"gallery_411231.html","maxRecords":0.0,"photoIDs":[7581560.0,7581561.0,7581563.0,7581564.0,7581566.0,7581557.0],"skipIndex":0,"section_code":"gallery","featured_images":"7581566,7581564,7581563,7581561,7581560,7581557","id":411231,"singleSection":false});				  						galleries[288545] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Diane Bowes","link":"gallery_288545.html","maxRecords":0.0,"photoIDs":[7417740.0,7417758.0,7417755.0,7417762.0,7417774.0,7417769.0],"skipIndex":0,"section_code":"gallery","featured_images":"7417774,7417769,7417762,7417758,7417755,7417740","id":288545,"singleSection":false});				  						galleries[288532] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Jim Griffin","link":"gallery_288532.html","maxRecords":0.0,"photoIDs":[5135918.0],"skipIndex":0,"section_code":"gallery","featured_images":5135918.0,"id":288532,"singleSection":false});				  						galleries[289359] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sarah Harrison","link":"gallery_289359.html","maxRecords":0.0,"photoIDs":[5121014.0,5121045.0,5121077.0,5616161.0,5616197.0,5616198.0,9080358.0],"skipIndex":0,"section_code":"gallery","featured_images":"9080358,5616198,5616197,5616161,5121077,5121045,5121014","id":289359,"singleSection":false});				  						galleries[433054] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Ian Whittaker","link":"gallery_433054.html","maxRecords":0.0,"photoIDs":[8087526.0,8087530.0,8087536.0,8087537.0,8087542.0,8087111.0],"skipIndex":0,"section_code":"gallery","featured_images":"8087542,8087537,8087536,8087530,8087526,8087111","id":433054,"singleSection":false});				  						galleries[293925] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Paul Friday","link":"gallery_293925.html","maxRecords":0.0,"photoIDs":[5206939.0,5206943.0,5206944.0,5206946.0,5206950.0,5206938.0],"skipIndex":0,"section_code":"gallery","featured_images":"5206950,5206946,5206944,5206943,5206939,5206938","id":293925,"singleSection":false});				  						galleries[365278] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"David Uffindall","link":"gallery_365278.html","maxRecords":0.0,"photoIDs":[6689762.0,6689769.0,6689771.0,6689775.0,6689780.0,6689784.0],"skipIndex":0,"section_code":"gallery","featured_images":"6689784,6689780,6689775,6689771,6689769,6689762","id":365278,"singleSection":false});				  						galleries[320376] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Stuart Gilkison","link":"gallery_320376.html","maxRecords":0.0,"photoIDs":[8571603.0,8571609.0,8571640.0,8571644.0,8571645.0,8571663.0],"skipIndex":0,"section_code":"gallery","featured_images":"8571663,8571645,8571644,8571640,8571609,8571603","id":320376,"singleSection":false});				  						galleries[450584] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Angie Willis","link":"gallery_450584.html","maxRecords":0.0,"photoIDs":[8525612.0,8525617.0,8525648.0],"skipIndex":0,"section_code":"gallery","featured_images":"8525648,8525617,8525612","id":450584,"singleSection":false});				  						galleries[450585] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Tom Willis","link":"gallery_450585.html","maxRecords":0.0,"photoIDs":[8525550.0,8525553.0,8525560.0],"skipIndex":0,"section_code":"gallery","featured_images":"8525560,8525553,8525550","id":450585,"singleSection":false});				  						galleries[450583] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Kathryn Carter","link":"gallery_450583.html","maxRecords":0.0,"photoIDs":[8525790.0,8525816.0,8525819.0,8525824.0,8525837.0],"skipIndex":0,"section_code":"gallery","featured_images":"8525837,8525824,8525819,8525816,8525790","id":450583,"singleSection":false});				  						galleries[381138] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Keith Wagner","link":"gallery_381138.html","maxRecords":0.0,"photoIDs":[7039538.0,7039563.0,7039566.0,8530646.0,8525747.0],"skipIndex":0,"section_code":"gallery","featured_images":"8530646,8525747,7039566,7039563,7039538","id":381138,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9080358';
imageSets[3] = '9080358,8571663,8571645,8571644,8571640,8571609,8571603,8530646,8525837,8525824,8525819,8525816,8525790,8525747,8525648,8525617,8525612,8525560,8525553,8525550,8087542,8087537,8087536,8087530,8087526,8087111,7581566,7581564,7581563,7581561,7581560,7581557,7417774,7417769,7417762,7417758,7417755,7417740,7039566,7039563,7039538,6752219,6689784,6689780,6689775,6689771,6689769,6689762,5616198,5616197';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/andrewrcps/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/andrewrcps/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 = 'Ripon Photographic Society: ' + 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;
	}
}

			

