window.thumbnails = {};
															thumbnails[7807862] = clik.newPhoto({"id":7807862,"src":"Touch_down_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Touching down after a long haul flight","height":76});
															thumbnails[8351268] = clik.newPhoto({"id":8351268,"src":"Cheetah-16_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351268.html","width":130,"caption":"Brothers in arms","height":86});
															thumbnails[8351281] = clik.newPhoto({"id":8351281,"src":"Cheetah-18_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351281.html","width":130,"caption":"The eyes have it","height":84});
															thumbnails[8351284] = clik.newPhoto({"id":8351284,"src":"Cheetah-19_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351284.html","width":130,"caption":"Brotherly love","height":117});
															thumbnails[8351404] = clik.newPhoto({"id":8351404,"src":"Nosepicker_thumb.jpg","galleries_id":419701,"server_id":35,"link":"photo_8351404.html","width":130,"caption":"Nose picker","height":159});
															thumbnails[8354706] = clik.newPhoto({"id":8354706,"src":"stalkinglion_thumb.jpg","galleries_id":419701,"server_id":35,"link":"photo_8354706.html","width":130,"caption":"This may not be your lucky day","height":47});
															thumbnails[8351416] = clik.newPhoto({"id":8351416,"src":"makemydaypunk_thumb.jpg","galleries_id":419701,"server_id":35,"link":"photo_8351416.html","width":130,"caption":"Make my day punk","height":96});
															thumbnails[8354448] = clik.newPhoto({"id":8354448,"src":"Lionyawn_thumb.jpg","galleries_id":419701,"server_id":35,"link":"photo_8354448.html","width":130,"caption":"Too tired to move","height":96});
															thumbnails[8351245] = clik.newPhoto({"id":8351245,"src":"Cheetah-15_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351245.html","width":130,"caption":"Its hello from me and goodbye from him.","height":87});
															thumbnails[8351287] = clik.newPhoto({"id":8351287,"src":"Cheetah-20_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351287.html","width":130,"caption":"The power of the cat","height":57});
															thumbnails[8352811] = clik.newPhoto({"id":8352811,"src":"Dressage_thumb.jpg","galleries_id":419701,"server_id":37,"link":"photo_8352811.html","width":130,"caption":"Dressage","height":84});
															thumbnails[8352804] = clik.newPhoto({"id":8352804,"src":"A_free_ride_thumb.jpg","galleries_id":419701,"server_id":37,"link":"photo_8352804.html","width":130,"caption":"A free ride","height":80});
															thumbnails[8350550] = clik.newPhoto({"id":8350550,"src":"Cheetah-4_thumb.jpg","galleries_id":443700,"server_id":37,"link":"photo_8350550.html","width":130,"caption":"Hunting mother with family of four cubs","height":74});
															thumbnails[8351235] = clik.newPhoto({"id":8351235,"src":"Cheetah-13_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351235.html","width":130,"caption":"The trip","height":116});
															thumbnails[8351237] = clik.newPhoto({"id":8351237,"src":"Cheetah-14_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351237.html","width":130,"caption":"The scream","height":92});
															thumbnails[8351043] = clik.newPhoto({"id":8351043,"src":"Cheetah-5_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351043.html","width":130,"caption":"Hidden in the grass","height":51});
															thumbnails[8351075] = clik.newPhoto({"id":8351075,"src":"Cheetah-6_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351075.html","width":130,"caption":"Zebra crossing","height":57});
															thumbnails[8351127] = clik.newPhoto({"id":8351127,"src":"Cheetah-7_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351127.html","width":130,"caption":"Taking the long view","height":158});
															thumbnails[8351170] = clik.newPhoto({"id":8351170,"src":"Cheetah-8_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351170.html","width":130,"caption":"Breakfast","height":73});
															thumbnails[8351204] = clik.newPhoto({"id":8351204,"src":"Cheetah-10_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351204.html","width":130,"caption":"Keep off","height":73});
															thumbnails[8351217] = clik.newPhoto({"id":8351217,"src":"Cheetah-111_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351217.html","width":130,"caption":"Kiss and make up","height":63});
															thumbnails[8351223] = clik.newPhoto({"id":8351223,"src":"Cheetah-12_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351223.html","width":130,"caption":"Supper's ready!","height":56});
															thumbnails[8101649] = clik.newPhoto({"id":8101649,"src":"The_eagle_prepares_thumb.jpg","galleries_id":419708,"server_id":32,"link":"photo_8101649.html","width":130,"caption":"Preparing to capture","height":89});
															thumbnails[8109067] = clik.newPhoto({"id":8109067,"src":"Return_to_temptation_thumb.jpg","galleries_id":419708,"server_id":32,"link":"photo_8109067.html","width":130,"caption":"Red Kite coming to the hand","height":88});
															thumbnails[8109077] = clik.newPhoto({"id":8109077,"src":"Focus_on_landing_thumb.jpg","galleries_id":419708,"server_id":32,"link":"photo_8109077.html","width":130,"caption":"Harris Hawk touching down","height":89});
															thumbnails[7806471] = clik.newPhoto({"id":7806471,"src":"In_the_climb_thumb.jpg","galleries_id":419708,"server_id":32,"link":"photo_7806471.html","width":130,"caption":"In the climb","height":56});
															thumbnails[7807857] = clik.newPhoto({"id":7807857,"src":"final_approach_thumb.jpg","galleries_id":419708,"server_id":32,"link":"photo_7807857.html","width":130,"caption":"Final approach","height":72});
															thumbnails[7893234] = clik.newPhoto({"id":7893234,"src":"Borneo-14_thumb.jpg","galleries_id":419708,"server_id":32,"link":"photo_7893234.html","width":130,"caption":"Hornbill flying in","height":54});
															thumbnails[7893241] = clik.newPhoto({"id":7893241,"src":"Borneo-15_thumb.jpg","galleries_id":419708,"server_id":32,"link":"photo_7893241.html","width":130,"caption":"Coming in for the kill","height":145});
															thumbnails[7805763] = clik.newPhoto({"id":7805763,"src":"River_side_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_7805763.html","width":130,"caption":"Rainforest Riverside","height":61});
															thumbnails[7893204] = clik.newPhoto({"id":7893204,"src":"Borneo-1_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_7893204.html","width":130,"caption":"Pure aggression","height":228});
															thumbnails[7893214] = clik.newPhoto({"id":7893214,"src":"Borneo-4_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_7893214.html","width":130,"caption":"Watching me, watching you","height":193});
															thumbnails[7893218] = clik.newPhoto({"id":7893218,"src":"Borneo-5_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_7893218.html","width":130,"caption":"Where have I seen that photographer before?","height":94});
															thumbnails[7893221] = clik.newPhoto({"id":7893221,"src":"Borneo-6_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_7893221.html","width":130,"caption":"A moment at the hairdresser","height":110});
															thumbnails[7893227] = clik.newPhoto({"id":7893227,"src":"Borneo-8_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_7893227.html","width":130,"caption":"Ready for the jump","height":96});
															thumbnails[7850408] = clik.newPhoto({"id":7850408,"src":"MrKingwaking_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_7850408.html","width":130,"caption":"Who set off my alarm","height":166});
															thumbnails[7799146] = clik.newPhoto({"id":7799146,"src":"lick_and_a_promise_thumb.jpg","galleries_id":443700,"server_id":32,"link":"photo_7799146.html","width":130,"caption":"A lick and a promise","height":105});
															thumbnails[8350538] = clik.newPhoto({"id":8350538,"src":"Cheetah-1_thumb.jpg","galleries_id":443700,"server_id":37,"link":"photo_8350538.html","width":130,"caption":"Cheetah cub on the run","height":97});
															thumbnails[8351277] = clik.newPhoto({"id":8351277,"src":"Cheetah-17_thumb.jpg","galleries_id":443700,"server_id":35,"link":"photo_8351277.html","width":130,"caption":"The future is an unknown country","height":113});
															thumbnails[7802761] = clik.newPhoto({"id":7802761,"src":"intimacy_thumb.jpg","galleries_id":419701,"server_id":32,"link":"photo_7802761.html","width":130,"caption":"Intimacy","height":144});
															thumbnails[7799126] = clik.newPhoto({"id":7799126,"src":"brothers_in_arms_thumb.jpg","galleries_id":419701,"server_id":32,"link":"photo_7799126.html","width":130,"caption":"Brother in arms","height":69});
															thumbnails[8350549] = clik.newPhoto({"id":8350549,"src":"Cheetah-3_thumb.jpg","galleries_id":443700,"server_id":37,"link":"photo_8350549.html","width":130,"caption":"Savannah - portrait of a heroine","height":165});
															thumbnails[7799158] = clik.newPhoto({"id":7799158,"src":"I_am_fierce_thumb.jpg","galleries_id":419701,"server_id":32,"link":"photo_7799158.html","width":130,"caption":"Buffalo - to close for comfort","height":98});
															thumbnails[7764773] = clik.newPhoto({"id":7764773,"src":"Alaska_fishing_bear_thumb.jpg","galleries_id":419683,"server_id":32,"link":"photo_7764773.html","width":130,"caption":"Fishing bear","height":105});
															thumbnails[7893251] = clik.newPhoto({"id":7893251,"src":"fishing_bear_thumb.jpg","galleries_id":419683,"server_id":32,"link":"photo_7893251.html","width":130,"caption":"Almost....","height":57});
															thumbnails[7893255] = clik.newPhoto({"id":7893255,"src":"paddling_bear_thumb.jpg","galleries_id":419683,"server_id":32,"link":"photo_7893255.html","width":130,"caption":"Too close for comfort","height":194});
															thumbnails[7913885] = clik.newPhoto({"id":7913885,"src":"attacking_bear_thumb.jpg","galleries_id":419683,"server_id":32,"link":"photo_7913885.html","width":130,"caption":"Total concentration","height":74});
															thumbnails[8109101] = clik.newPhoto({"id":8109101,"src":"Purple_Crested_Roller_thumb.jpg","galleries_id":419708,"server_id":32,"link":"photo_8109101.html","width":130,"caption":"Purple Crested Roller","height":81});
															thumbnails[7913942] = clik.newPhoto({"id":7913942,"src":"Only_one_way_in_and_one_way_out_thumb.jpg","galleries_id":419683,"server_id":32,"link":"photo_7913942.html","width":130,"caption":"One way in and one way out","height":46});
															thumbnails[6504477] = clik.newPhoto({"id":6504477,"src":"_bob6257_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_6504477.html","width":130,"caption":"The Heat of the Rainforest","height":87});
															thumbnails[7390027] = clik.newPhoto({"id":7390027,"src":"01_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7390027.html","width":130,"caption":"Child of light","height":167});
															thumbnails[7914058] = clik.newPhoto({"id":7914058,"src":"Kodiak_from_the_Katmai_thumb.jpg","galleries_id":419683,"server_id":32,"link":"photo_7914058.html","width":130,"caption":"Back across the sound towards Kodiak from the Katmai","height":40});
															thumbnails[7436977] = clik.newPhoto({"id":7436977,"src":"_bob8365-Edit_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7436977.html","width":130,"caption":"The joy of the high wire","height":94});
															thumbnails[7764796] = clik.newPhoto({"id":7764796,"src":"Family_Day_Out_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7764796.html","width":130,"caption":"Family day out by the river","height":99});
															thumbnails[7914028] = clik.newPhoto({"id":7914028,"src":"isolation_of_the_Katmai_thumb.jpg","galleries_id":419683,"server_id":32,"link":"photo_7914028.html","width":130,"caption":"Isolation of the Katmai","height":46});
															thumbnails[7390059] = clik.newPhoto({"id":7390059,"src":"03_thumb.jpg","galleries_id":419701,"server_id":32,"link":"photo_7390059.html","width":130,"caption":"Monkey stare","height":87});
															thumbnails[6504504] = clik.newPhoto({"id":6504504,"src":"_bob6062_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_6504504.html","width":130,"caption":"Who's watching who?","height":64});
															thumbnails[7436945] = clik.newPhoto({"id":7436945,"src":"flying_moggie_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7436945.html","width":130,"caption":"The flying moggie","height":97});
															thumbnails[7764850] = clik.newPhoto({"id":7764850,"src":"Morning_horror_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7764850.html","width":130,"caption":"Morning horror","height":162});
															thumbnails[6504801] = clik.newPhoto({"id":6504801,"src":"_bob6135_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_6504801.html","width":130,"caption":"The end of a hard day","height":60});
															thumbnails[7436959] = clik.newPhoto({"id":7436959,"src":"horror-Edit_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_7436959.html","width":130,"caption":"Horror","height":247});
															thumbnails[6505055] = clik.newPhoto({"id":6505055,"src":"_bob6231_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_6505055.html","width":130,"caption":"Stillness of the river","height":87});
															thumbnails[7437018] = clik.newPhoto({"id":7437018,"src":"_bob5853-Edit_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7437018.html","width":130,"caption":"Mr King - wild male OrangUtan","height":187});
															thumbnails[6505065] = clik.newPhoto({"id":6505065,"src":"_bob6318_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_6505065.html","width":130,"caption":"Who holds the bridge?","height":179});
															thumbnails[7436929] = clik.newPhoto({"id":7436929,"src":"flailingbear_thumb.jpg","galleries_id":419683,"server_id":32,"link":"photo_7436929.html","width":130,"caption":"Just dry off before I sort out this photographer","height":87});
															thumbnails[7436953] = clik.newPhoto({"id":7436953,"src":"_bob2614-Edit-2_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7436953.html","width":130,"caption":"Mistress of her domain","height":87});
															thumbnails[7764784] = clik.newPhoto({"id":7764784,"src":"Alert_for_fish_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7764784.html","width":130,"caption":"Bear Alert","height":94});
															thumbnails[7436981] = clik.newPhoto({"id":7436981,"src":"_bob3762-Edit-2_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7436981.html","width":130,"caption":"Wild and waiting","height":100});
															thumbnails[7436968] = clik.newPhoto({"id":7436968,"src":"feline_beauty_thumb.jpg","galleries_id":356465,"server_id":32,"link":"photo_7436968.html","width":130,"caption":"Feline beauty","height":165});
															thumbnails[7436989] = clik.newPhoto({"id":7436989,"src":"Scotland_March_2009-194-Edit_thumb.jpg","galleries_id":419708,"server_id":32,"link":"photo_7436989.html","width":130,"caption":"The eyes have it","height":203});
															thumbnails[7437001] = clik.newPhoto({"id":7437001,"src":"_BOB1112-Edit_thumb.jpg","galleries_id":419701,"server_id":32,"link":"photo_7437001.html","width":130,"caption":"Caught out","height":134});
															thumbnails[7437010] = clik.newPhoto({"id":7437010,"src":"_bob2532-Edit-2_thumb.jpg","galleries_id":419701,"server_id":32,"link":"photo_7437010.html","width":130,"caption":"Too young to bother.","height":95});
															thumbnails[7437031] = clik.newPhoto({"id":7437031,"src":"DSC_0037-Edit_thumb.jpg","galleries_id":419701,"server_id":32,"link":"photo_7437031.html","width":130,"caption":"Dentists' delight","height":71});
															thumbnails[7437038] = clik.newPhoto({"id":7437038,"src":"_bob6804-Edit-3_thumb.jpg","galleries_id":356464,"server_id":32,"link":"photo_7437038.html","width":130,"caption":"Call me casual","height":160});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[419701] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"African Wildlife","link":"gallery_419701.html","maxRecords":0.0,"photoIDs":[8351404.0,8354706.0,8351416.0,8354448.0,8352811.0,8352804.0,7802761.0,7799126.0,7799158.0,7390059.0,7437001.0,7437010.0,7437031.0],"skipIndex":0,"section_code":"gallery","featured_images":"8354706,8354448,8352811,8352804,8351416,8351404,7802761,7799158,7799126,7437031","id":419701,"singleSection":false});				  						galleries[419708] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Birds of the World","link":"gallery_419708.html","maxRecords":0.0,"photoIDs":[8101649.0,8109067.0,8109077.0,7806471.0,7807857.0,7893234.0,7893241.0,8109101.0,7436989.0],"skipIndex":0,"section_code":"gallery","featured_images":"8109101,8109077,8109067,8101649,7893241,7893234,7807857,7806471,7436989","id":419708,"singleSection":false});				  						galleries[443700] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cheetah Project","link":"gallery_443700.html","maxRecords":0.0,"photoIDs":[8351268.0,8351281.0,8351284.0,8351245.0,8351287.0,8350550.0,8351235.0,8351237.0,8351043.0,8351075.0,8351127.0,8351170.0,8351204.0,8351217.0,8351223.0,7799146.0,8350538.0,8351277.0,8350549.0],"skipIndex":0,"section_code":"gallery","featured_images":"8351287,8351284,8351281,8351277,8351268,8351245,8351237,8351235,8351223,8351217","id":443700,"singleSection":false});				  						galleries[356465] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"LRPS submission","link":"gallery_356465.html","maxRecords":0.0,"photoIDs":[7390027.0,7436977.0,7764796.0,7436945.0,7764850.0,7437018.0,7436953.0,7764784.0,7436981.0,7436968.0],"skipIndex":0,"section_code":"gallery","featured_images":"7764850,7764796,7764784,7437018,7436981,7436977,7436968,7436953,7436945,7390027","id":356465,"singleSection":false});				  						galleries[419683] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Visions of Alaska","link":"gallery_419683.html","maxRecords":0.0,"photoIDs":[7764773.0,7893251.0,7893255.0,7913885.0,7913942.0,7914058.0,7914028.0,7436929.0],"skipIndex":0,"section_code":"gallery","featured_images":"7914058,7914028,7913942,7913885,7893255,7893251,7764773,7436929","id":419683,"singleSection":false});				  						galleries[356464] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Visions of the Rainforest","link":"gallery_356464.html","maxRecords":0.0,"photoIDs":[7805763.0,7893204.0,7893214.0,7893218.0,7893221.0,7893227.0,7850408.0,6504477.0,6504504.0,6504801.0,7436959.0,6505055.0,6505065.0,7437038.0],"skipIndex":0,"section_code":"gallery","featured_images":"7893227,7893221,7893218,7893214,7893204,7850408,7805763,7437038,7436959,6505065","id":356464,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8354706,8354448,8352811,8352804,8351416,8351404,8351287,8351284,8351281,8351277,8351268,8351245,8351237,8351235,8351223,8351217,8351204,8351170,8351127,8351075,8351043,8350550,8350549,8350538,8109101,8109077,8109067,8101649,7914058,7914028,7913942,7913885,7893255,7893251,7893241,7893234,7893227,7893221,7893218,7893214,7893204,7850408,7807862,7807857,7806471,7805763,7802761,7799158,7799146,7799126';
imageSets[3] = '8354706,8354448,8352811,8352804,8351416,8351404,8351287,8351284,8351281,8351277,8351268,8351245,8351237,8351235,8351223,8351217,8351204,8351170,8351127,8351075,8351043,8350550,8350549,8350538,8109101,8109077,8109067,8101649,7914058,7914028,7913942,7913885,7893255,7893251,7893241,7893234,7893227,7893221,7893218,7893214,7893204,7850408,7807862,7807857,7806471,7805763,7802761,7799158,7799146,7799126';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/BobRyan/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/BobRyan/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Wandering Light 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> &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="">';
					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="">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id),					title: galleries[gallery_id].title				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

