window.thumbnails = {};
															thumbnails[8514782] = clik.newPhoto({"id":8514782,"src":"_MG_8060_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":160,"caption":"Long pools at Mana Pools","height":107});
															thumbnails[7250563] = clik.newPhoto({"id":7250563,"src":"Ranthanbore-Framed_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250563.html","width":160,"caption":"Rantambore - a spectacular national park of tigers, deer and ruins","height":111});
															thumbnails[7250583] = clik.newPhoto({"id":7250583,"src":"TigerGrass-copySH_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250583.html","width":160,"caption":"Tiger hunting in Bandhavgarh in the early evening light","height":107});
															thumbnails[7250588] = clik.newPhoto({"id":7250588,"src":"TigerUnderGrowth-copy_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250588.html","width":160,"caption":"Tiger viewed from elephant back in Kanha NP","height":107});
															thumbnails[7250590] = clik.newPhoto({"id":7250590,"src":"Roller_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250590.html","width":160,"caption":"Roller perched in Kanha NP","height":104});
															thumbnails[7250594] = clik.newPhoto({"id":7250594,"src":"CrocodileTreepsd_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250594.html","width":160,"caption":"Crocodile tree bark in Kanha NP","height":242});
															thumbnails[7250606] = clik.newPhoto({"id":7250606,"src":"Elepphant-Ornate_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250606.html","width":160,"caption":"Elephant in ceremonial robe Bandhavgarh","height":109});
															thumbnails[7250614] = clik.newPhoto({"id":7250614,"src":"LMonkeys_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250614.html","width":160,"caption":"Langur monkeys warming in the morning sun in Kanha NP","height":107});
															thumbnails[7250620] = clik.newPhoto({"id":7250620,"src":"TigerFaceClose_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250620.html","width":160,"caption":"Close up of resting tiger in Kanha NP","height":107});
															thumbnails[7250627] = clik.newPhoto({"id":7250627,"src":"ElephantFeet_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250627.html","width":160,"caption":"Chained feet of elephant used for tourists to go off road viewing tigers","height":107});
															thumbnails[7250634] = clik.newPhoto({"id":7250634,"src":"IndianElephantEye_thumb.jpg","galleries_id":392122,"server_id":5,"link":"photo_7250634.html","width":160,"caption":"Indian elephant eye","height":107});
															thumbnails[8519307] = clik.newPhoto({"id":8519307,"src":"De-Hoop_110808_0157_thumb.jpg","galleries_id":450092,"server_id":5,"link":"photo_8519307.html","width":160,"caption":"Cape clawless otter on the vlei at dawn","height":107});
															thumbnails[8519310] = clik.newPhoto({"id":8519310,"src":"De-Hoop_110808_0153_thumb.jpg","galleries_id":450092,"server_id":5,"link":"photo_8519310.html","width":160,"caption":"Inquisitive cape clawless otter","height":107});
															thumbnails[8519313] = clik.newPhoto({"id":8519313,"src":"De-Hoop_110806_0124_thumb.jpg","galleries_id":450092,"server_id":5,"link":"photo_8519313.html","width":160,"caption":"Vlei at sunset","height":107});
															thumbnails[8514710] = clik.newPhoto({"id":8514710,"src":"_MG_7994_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514710.html","width":160,"caption":"Glossy ibis against relection at Mana Mouth","height":107});
															thumbnails[8514747] = clik.newPhoto({"id":8514747,"src":"_MG_8084_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514747.html","width":160,"caption":"Bee-eaters perched near Mana Mouth","height":107});
															thumbnails[8545374] = clik.newPhoto({"id":8545374,"src":"110904_0242_thumb.jpg","galleries_id":450092,"server_id":19,"link":"photo_8545374.html","width":160,"caption":"Sacred ibis in the Postberg flowers","height":107});
															thumbnails[8514727] = clik.newPhoto({"id":8514727,"src":"_MG_8040_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514727.html","width":160,"caption":"Hippo on the banks of the Zambezi","height":102});
															thumbnails[8514739] = clik.newPhoto({"id":8514739,"src":"_MG_8059_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514739.html","width":160,"caption":"Evening scene in the beautiful wooded areas ","height":107});
															thumbnails[8514753] = clik.newPhoto({"id":8514753,"src":"_MG_8165_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514753.html","width":160,"caption":"Wild dog on the road as we left","height":107});
															thumbnails[8514760] = clik.newPhoto({"id":8514760,"src":"_MG_8020_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514760.html","width":160,"caption":"Evening reflection of glossy ibis","height":107});
															thumbnails[8514762] = clik.newPhoto({"id":8514762,"src":"_MG_8054_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514762.html","width":160,"caption":"Mother hippo and young","height":107});
															thumbnails[8514775] = clik.newPhoto({"id":8514775,"src":"_MG_8131_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514775.html","width":160,"caption":"Pack of wild dogs on the main dirt road","height":107});
															thumbnails[6504473] = clik.newPhoto({"id":6504473,"src":"Bots-09-1Nxai---005comp-copy-copy_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6504473.html","width":130,"caption":"Tower of giraffes","height":87});
															thumbnails[6507872] = clik.newPhoto({"id":6507872,"src":"Otter2_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6507872.html","width":130,"caption":"Giant River Otter","height":87});
															thumbnails[6510976] = clik.newPhoto({"id":6510976,"src":"IMG_0300_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6510976.html","width":130,"caption":"Burchell's Zebra","height":87});
															thumbnails[8514795] = clik.newPhoto({"id":8514795,"src":"_MG_80601_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514795.html","width":160,"caption":"Long pool at Mana Pools","height":107});
															thumbnails[8519301] = clik.newPhoto({"id":8519301,"src":"De-Hoop_110808_0197_thumb.jpg","galleries_id":450092,"server_id":5,"link":"photo_8519301.html","width":160,"caption":"Great crested grebe on the vlei at sunset","height":107});
															thumbnails[8514784] = clik.newPhoto({"id":8514784,"src":"_MG_7882_thumb.jpg","galleries_id":450093,"server_id":5,"link":"photo_8514784.html","width":160,"caption":"Sundowners on the banks of the Zambezi","height":107});
															thumbnails[6503903] = clik.newPhoto({"id":6503903,"src":"FLAT_MG_5635a1_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6503903.html","width":130,"caption":"Elephant and egrets in the Ngorongoro crater","height":87});
															thumbnails[6504468] = clik.newPhoto({"id":6504468,"src":"Bots-09-4Meno---294_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6504468.html","width":130,"caption":"Elephant reflection","height":82});
															thumbnails[6510985] = clik.newPhoto({"id":6510985,"src":"IMG_0304_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6510985.html","width":130,"caption":"Impala Umfolozi NP","height":87});
															thumbnails[8519304] = clik.newPhoto({"id":8519304,"src":"De-Hoop_110806_0106_thumb.jpg","galleries_id":450092,"server_id":5,"link":"photo_8519304.html","width":160,"caption":"Southern right whale tail-lobbing","height":107});
															thumbnails[8545376] = clik.newPhoto({"id":8545376,"src":"PostbergW_110904_0314_thumb.jpg","galleries_id":450092,"server_id":19,"link":"photo_8545376.html","width":160,"caption":"Postberg flowers in close up","height":107});
															thumbnails[6508030] = clik.newPhoto({"id":6508030,"src":"_MG_4104_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6508030.html","width":130,"caption":"Scarlet Macaws","height":87});
															thumbnails[6508033] = clik.newPhoto({"id":6508033,"src":"_MG_4614a_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6508033.html","width":130,"caption":"Scarlet Macaws","height":87});
															thumbnails[6504482] = clik.newPhoto({"id":6504482,"src":"Bots-09-4Meno---149_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6504482.html","width":130,"caption":"Zebra drinking at the Boteti river","height":87});
															thumbnails[6511017] = clik.newPhoto({"id":6511017,"src":"IMG_0330_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6511017.html","width":130,"caption":"African Elephant","height":87});
															thumbnails[8519305] = clik.newPhoto({"id":8519305,"src":"De-Hoop_110806_0116_thumb.jpg","galleries_id":450092,"server_id":5,"link":"photo_8519305.html","width":160,"caption":"Southern right whale half breaching","height":107});
															thumbnails[8545377] = clik.newPhoto({"id":8545377,"src":"PostbergW_110904_0335_thumb.jpg","galleries_id":450092,"server_id":19,"link":"photo_8545377.html","width":160,"caption":"Whites, oranges and lilacs","height":107});
															thumbnails[6508047] = clik.newPhoto({"id":6508047,"src":"_MG_4351_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6508047.html","width":130,"caption":"Mealy Parrots","height":87});
															thumbnails[6508049] = clik.newPhoto({"id":6508049,"src":"_MG_4174_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6508049.html","width":130,"caption":"Black Spider Monkey","height":87});
															thumbnails[6503236] = clik.newPhoto({"id":6503236,"src":"E_MG_5948-copy_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6503236.html","width":130,"caption":"Lions in grass","height":87});
															thumbnails[6507877] = clik.newPhoto({"id":6507877,"src":"_MG_4189_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6507877.html","width":130,"caption":"Spider Monker 1","height":87});
															thumbnails[6508031] = clik.newPhoto({"id":6508031,"src":"_MG_4165_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6508031.html","width":130,"caption":"Amazon Reflection","height":87});
															thumbnails[6514874] = clik.newPhoto({"id":6514874,"src":"IMG_0442_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6514874.html","width":130,"caption":"Long Tailed Shrike","height":87});
															thumbnails[8545378] = clik.newPhoto({"id":8545378,"src":"PostbergW_110904_0353_thumb.jpg","galleries_id":450092,"server_id":19,"link":"photo_8545378.html","width":160,"caption":"Old farm buildings by lake near Darling","height":107});
															thumbnails[6505990] = clik.newPhoto({"id":6505990,"src":"Bots-09-1Nxai---053a_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6505990.html","width":130,"caption":"Giraffes charge","height":88});
															thumbnails[6504514] = clik.newPhoto({"id":6504514,"src":"Bots-09-1Nxai---112b_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6504514.html","width":130,"caption":"Giraffes at sunset","height":201});
															thumbnails[6503258] = clik.newPhoto({"id":6503258,"src":"E_MG_5841cropa_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6503258.html","width":130,"caption":"Zebras trotting along the lake shore in the early morning","height":88});
															thumbnails[6505992] = clik.newPhoto({"id":6505992,"src":"Bots-09-1Nxai---171_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6505992.html","width":130,"caption":"Lions to water","height":76});
															thumbnails[6514903] = clik.newPhoto({"id":6514903,"src":"IMG_0477_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6514903.html","width":130,"caption":"Elephants at play","height":65});
															thumbnails[6514962] = clik.newPhoto({"id":6514962,"src":"Bots-09-2Makg---067_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6514962.html","width":130,"caption":"Helmeted Guinea Fowl","height":87});
															thumbnails[6508037] = clik.newPhoto({"id":6508037,"src":"_MG_4632_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6508037.html","width":130,"caption":"Butterfly and Terrapin","height":87});
															thumbnails[6503269] = clik.newPhoto({"id":6503269,"src":"FLAT_MG_5674_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6503269.html","width":130,"caption":"Cheetah stalking in the Ngorongoro crater","height":85});
															thumbnails[6503081] = clik.newPhoto({"id":6503081,"src":"FLAT_MG_5532_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6503081.html","width":130,"caption":"Male Lion at Maasai Koppies, Serengeti","height":87});
															thumbnails[6503291] = clik.newPhoto({"id":6503291,"src":"FLAT_MG_5662a_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6503291.html","width":130,"caption":"Elephant in the Ngorogoro crater","height":87});
															thumbnails[6506134] = clik.newPhoto({"id":6506134,"src":"Bots-09-2Makg---014_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6506134.html","width":130,"caption":"Hippos at Boteti pools","height":87});
															thumbnails[6508043] = clik.newPhoto({"id":6508043,"src":"_MG_4646_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6508043.html","width":130,"caption":"Giant River Otter","height":87});
															thumbnails[6503405] = clik.newPhoto({"id":6503405,"src":"_MG_4726a_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6503405.html","width":130,"caption":"Cheetah Tarangire NP","height":87});
															thumbnails[6506140] = clik.newPhoto({"id":6506140,"src":"Bots-09-2Makg---054_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6506140.html","width":130,"caption":"Lioness with cubs Xhumaga NP","height":87});
															thumbnails[6514921] = clik.newPhoto({"id":6514921,"src":"IMG_0828full_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6514921.html","width":130,"caption":"Elephants at sunset in Moremi","height":87});
															thumbnails[6514925] = clik.newPhoto({"id":6514925,"src":"IMG_0859full_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6514925.html","width":130,"caption":"Glossy Ibis","height":87});
															thumbnails[6503535] = clik.newPhoto({"id":6503535,"src":"_MG_4946_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6503535.html","width":130,"caption":"Mother Zebra and foal","height":87});
															thumbnails[6506142] = clik.newPhoto({"id":6506142,"src":"Bots-09-3CKal---008_thumb.jpg","galleries_id":357912,"server_id":5,"link":"photo_6506142.html","width":130,"caption":"Impala Central Kalahari","height":85});
															thumbnails[6508044] = clik.newPhoto({"id":6508044,"src":"_MG_4664_thumb.jpg","galleries_id":358020,"server_id":5,"link":"photo_6508044.html","width":130,"caption":"Misty Amazon Morning","height":87});
															thumbnails[6505285] = clik.newPhoto({"id":6505285,"src":"_MG_5719_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6505285.html","width":130,"caption":"Black Rhino","height":87});
															thumbnails[6514929] = clik.newPhoto({"id":6514929,"src":"IMG_0862full_603543E0-24E8-5EC4-4F188161C805A14D_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6514929.html","width":130,"caption":"Glossy Ibis Takes Flight","height":87});
															thumbnails[6503518] = clik.newPhoto({"id":6503518,"src":"_MG_6057_thumb.jpg","galleries_id":357911,"server_id":5,"link":"photo_6503518.html","width":130,"caption":"Sunset in the Seronera","height":87});
															thumbnails[6514932] = clik.newPhoto({"id":6514932,"src":"IMG_0912_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6514932.html","width":130,"caption":"Sunset On The Chobe River","height":87});
															thumbnails[6514915] = clik.newPhoto({"id":6514915,"src":"IMG_0778_thumb.jpg","galleries_id":358224,"server_id":5,"link":"photo_6514915.html","width":130,"caption":"Long Tailed Glossy Starling","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[450092] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Western Cape 2011","link":"gallery_450092.html","maxRecords":0.0,"photoIDs":[8519307.0,8519310.0,8519313.0,8545374.0,8519301.0,8519304.0,8545376.0,8519305.0,8545377.0,8545378.0],"skipIndex":0,"section_code":"gallery","featured_images":"8545374,8519301","id":450092,"singleSection":false});				  						galleries[450093] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Mana Pools Zimbabwe 2011","link":"gallery_450093.html","maxRecords":0.0,"photoIDs":[8514710.0,8514747.0,8514727.0,8514739.0,8514753.0,8514760.0,8514762.0,8514775.0,8514795.0,8514784.0],"skipIndex":0,"section_code":"gallery","featured_images":8514747.0,"id":450093,"singleSection":false});				  						galleries[357911] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Tanzania 2010","link":"gallery_357911.html","maxRecords":0.0,"photoIDs":[6503903.0,6503236.0,6503258.0,6503269.0,6503081.0,6503291.0,6503405.0,6503535.0,6505285.0,6503518.0],"skipIndex":0,"section_code":"gallery","featured_images":6503236.0,"id":357911,"singleSection":false});				  						galleries[357912] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Botswana 2009","link":"gallery_357912.html","maxRecords":0.0,"photoIDs":[6504473.0,6504468.0,6504482.0,6505990.0,6504514.0,6505992.0,6514962.0,6506134.0,6506140.0,6506142.0],"skipIndex":0,"section_code":"gallery","featured_images":6505990.0,"id":357912,"singleSection":false});				  						galleries[358020] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Peru 2009","link":"gallery_358020.html","maxRecords":0.0,"photoIDs":[6507872.0,6508030.0,6508033.0,6508047.0,6508049.0,6507877.0,6508031.0,6508037.0,6508043.0,6508044.0],"skipIndex":0,"section_code":"gallery","featured_images":6508030.0,"id":358020,"singleSection":false});				  						galleries[358224] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"South Africa & Botswana 2007","link":"gallery_358224.html","maxRecords":0.0,"photoIDs":[6510976.0,6510985.0,6511017.0,6514874.0,6514903.0,6514921.0,6514925.0,6514929.0,6514932.0,6514915.0],"skipIndex":0,"section_code":"gallery","featured_images":6514929.0,"id":358224,"singleSection":false});				  						galleries[392122] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"India 2007 and 2009","link":"gallery_392122.html","maxRecords":0.0,"photoIDs":[7250563.0,7250583.0,7250588.0,7250590.0,7250594.0,7250606.0,7250614.0,7250620.0,7250627.0,7250634.0],"skipIndex":0,"section_code":"gallery","featured_images":7250606.0,"id":392122,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6506142';
imageSets[2] = '7250606,8545374,8514747,8519301,6508030,6503236,6505990,6514929';
imageSets[3] = '8545378,8545377,8545376,8545374,8519313,8519310,8519307,8519305,8519304,8519301,8514795,8514784,8514782,8514775,8514762,8514760,8514753,8514747,8514739,8514727,8514710,7250634,7250627,7250620,7250614,7250606,7250594,7250590,7250588,7250583,7250563,6514962,6514932,6514929,6514925,6514921,6514915,6514903,6514874,6511017,6510985,6510976,6508049,6508047,6508044,6508043,6508037,6508033,6508031,6508030';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/mikekendrick1930/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/mikekendrick1930/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 = 'mike kendrick 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.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 += '<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;
	}
}

			

