window.thumbnails = {};
															thumbnails[7048188] = clik.newPhoto({"id":7048188,"src":"Ray-of-Light_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"'Ray of Light' by Jamie Boots","height":110});
															thumbnails[7085939] = clik.newPhoto({"id":7085939,"src":"Young-Stoat_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"'Young stoat' by Anne Swatton","height":156});
															thumbnails[7200695] = clik.newPhoto({"id":7200695,"src":"_DSC1798_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7267509] = clik.newPhoto({"id":7267509,"src":"Durdle-Door_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7267512] = clik.newPhoto({"id":7267512,"src":"wave_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7278683] = clik.newPhoto({"id":7278683,"src":"DSC1885_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7320664] = clik.newPhoto({"id":7320664,"src":"Cheetah_card_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7320666] = clik.newPhoto({"id":7320666,"src":"Tiger_b_card_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":187});
															thumbnails[7323737] = clik.newPhoto({"id":7323737,"src":"FOX1927crop_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":88});
															thumbnails[7323738] = clik.newPhoto({"id":7323738,"src":"L2517crop_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":256});
															thumbnails[7323741] = clik.newPhoto({"id":7323741,"src":"MK2383crop_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":99});
															thumbnails[7562830] = clik.newPhoto({"id":7562830,"src":"2492_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7562831] = clik.newPhoto({"id":7562831,"src":"2415_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":84});
															thumbnails[7573970] = clik.newPhoto({"id":7573970,"src":"2358-sun-downer_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7573972] = clik.newPhoto({"id":7573972,"src":"2379_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":88});
															thumbnails[7700305] = clik.newPhoto({"id":7700305,"src":"_DSC2490_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"A Maasai village, and goat.","height":87});
															thumbnails[7700308] = clik.newPhoto({"id":7700308,"src":"_DSC2496_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Just about to give Alex a beautiful bracelet that had been hand made for him.","height":87});
															thumbnails[7700310] = clik.newPhoto({"id":7700310,"src":"_DSC2509_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Not much to do here is there?","height":87});
															thumbnails[8654121] = clik.newPhoto({"id":8654121,"src":"_DSC3053-swans_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":72});
															thumbnails[7039915] = clik.newPhoto({"id":7039915,"src":"_DSC0015_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7039915.html","width":130,"caption":"Badger","height":84});
															thumbnails[7039918] = clik.newPhoto({"id":7039918,"src":"_DSC0376-crop_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7039918.html","width":130,"caption":"Badger","height":90});
															thumbnails[7039919] = clik.newPhoto({"id":7039919,"src":"_DSC0599_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7039919.html","width":130,"caption":"Red Fox","height":87});
															thumbnails[7044947] = clik.newPhoto({"id":7044947,"src":"Longleat-067_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7044947.html","width":130,"caption":"Otter","height":179});
															thumbnails[7072944] = clik.newPhoto({"id":7072944,"src":"BB1024_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7072944.html","width":130,"caption":"Bluebell close up","height":196});
															thumbnails[7072945] = clik.newPhoto({"id":7072945,"src":"BB3089_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7072945.html","width":130,"caption":"Backlit Bluebell","height":196});
															thumbnails[7072947] = clik.newPhoto({"id":7072947,"src":"CSORCH0675_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7072947.html","width":130,"caption":"Common Spotted Orchid","height":195});
															thumbnails[7085888] = clik.newPhoto({"id":7085888,"src":"Lemur-045_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7085888.html","width":130,"caption":"Ring Tailed Lemur","height":194});
															thumbnails[7086107] = clik.newPhoto({"id":7086107,"src":"R3772_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7086107.html","width":130,"caption":"Winter Robin ","height":86});
															thumbnails[7087036] = clik.newPhoto({"id":7087036,"src":"Foxglove07181_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7087036.html","width":130,"caption":"Backlit Foxglove ","height":212});
															thumbnails[7087080] = clik.newPhoto({"id":7087080,"src":"MH0816_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7087080.html","width":130,"caption":"Marsh Helliborine Orchid ","height":195});
															thumbnails[7087093] = clik.newPhoto({"id":7087093,"src":"GWORCH1432_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7087093.html","width":130,"caption":"Green-winged Orchid ","height":196});
															thumbnails[7087100] = clik.newPhoto({"id":7087100,"src":"FORCH0657_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7087100.html","width":130,"caption":"Fragrant Orchid ","height":195});
															thumbnails[7087123] = clik.newPhoto({"id":7087123,"src":"Fox08061_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7087123.html","width":130,"caption":"Red Fox in evening light","height":84});
															thumbnails[7095279] = clik.newPhoto({"id":7095279,"src":"SNHF3989_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7095279.html","width":130,"caption":"Snakeshead Fritillary","height":196});
															thumbnails[7095286] = clik.newPhoto({"id":7095286,"src":"Livingstone-Daisy_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7095286.html","width":130,"caption":"Livingstone Daisy","height":87});
															thumbnails[7095296] = clik.newPhoto({"id":7095296,"src":"FG1788_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7095296.html","width":130,"caption":"Bumble Bee","height":86});
															thumbnails[7117802] = clik.newPhoto({"id":7117802,"src":"EP0507_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7117802.html","width":130,"caption":"Early Purple Orchid","height":195});
															thumbnails[7117808] = clik.newPhoto({"id":7117808,"src":"CSORCH1757_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7117808.html","width":130,"caption":"Common Spotted Orchid <em>Dactylorhiza fuchsii<\/em>","height":196});
															thumbnails[7117809] = clik.newPhoto({"id":7117809,"src":"GBORCH1760_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7117809.html","width":130,"caption":"","height":196});
															thumbnails[7117810] = clik.newPhoto({"id":7117810,"src":"BHEART3046_thumb.jpg","galleries_id":382993,"server_id":32,"link":"photo_7117810.html","width":130,"caption":"Bleeding Heart","height":196});
															thumbnails[7122384] = clik.newPhoto({"id":7122384,"src":"Fox1075_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7122384.html","width":130,"caption":"Fox","height":87});
															thumbnails[7122403] = clik.newPhoto({"id":7122403,"src":"_DSC1637_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7122403.html","width":130,"caption":"","height":83});
															thumbnails[7150935] = clik.newPhoto({"id":7150935,"src":"Swan3675_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7150935.html","width":130,"caption":"Mute Swan","height":86});
															thumbnails[7151009] = clik.newPhoto({"id":7151009,"src":"_DSC0356_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7151009.html","width":130,"caption":"Badger ","height":87});
															thumbnails[7151185] = clik.newPhoto({"id":7151185,"src":"_DSC0673_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7151185.html","width":130,"caption":"Amur Tiger","height":87});
															thumbnails[7151188] = clik.newPhoto({"id":7151188,"src":"_DSC0799_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7151188.html","width":130,"caption":"Amur Tiger","height":87});
															thumbnails[7151202] = clik.newPhoto({"id":7151202,"src":"Fox0621_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_7151202.html","width":130,"caption":"Red Fox","height":195});
															thumbnails[7155185] = clik.newPhoto({"id":7155185,"src":"MK23831_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7155185.html","width":130,"caption":"Meerkat","height":196});
															thumbnails[7155192] = clik.newPhoto({"id":7155192,"src":"OT2110_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7155192.html","width":130,"caption":"Otter","height":196});
															thumbnails[7155198] = clik.newPhoto({"id":7155198,"src":"MK2329_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7155198.html","width":130,"caption":"Meerkat kitten","height":196});
															thumbnails[7155200] = clik.newPhoto({"id":7155200,"src":"FOX1916_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7155200.html","width":130,"caption":"Red Foxes","height":86});
															thumbnails[7162705] = clik.newPhoto({"id":7162705,"src":"_DSC0461_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7162705.html","width":130,"caption":"Gorilla","height":87});
															thumbnails[7211241] = clik.newPhoto({"id":7211241,"src":"BA2181_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7211241.html","width":130,"caption":"","height":86});
															thumbnails[7211243] = clik.newPhoto({"id":7211243,"src":"FOX1908_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7211243.html","width":130,"caption":"","height":86});
															thumbnails[7211245] = clik.newPhoto({"id":7211245,"src":"FOX1927_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7211245.html","width":130,"caption":"Young Fox","height":196});
															thumbnails[7560883] = clik.newPhoto({"id":7560883,"src":"1320_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7560883.html","width":130,"caption":"","height":87});
															thumbnails[7560887] = clik.newPhoto({"id":7560887,"src":"2293_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7560887.html","width":130,"caption":"","height":87});
															thumbnails[7560888] = clik.newPhoto({"id":7560888,"src":"1265_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7560888.html","width":130,"caption":"","height":87});
															thumbnails[7562818] = clik.newPhoto({"id":7562818,"src":"2026_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7562818.html","width":130,"caption":"","height":87});
															thumbnails[7562820] = clik.newPhoto({"id":7562820,"src":"2308_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7562820.html","width":130,"caption":"","height":87});
															thumbnails[7562821] = clik.newPhoto({"id":7562821,"src":"2395_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7562821.html","width":130,"caption":"","height":87});
															thumbnails[7562823] = clik.newPhoto({"id":7562823,"src":"2261_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7562823.html","width":130,"caption":"","height":87});
															thumbnails[7562825] = clik.newPhoto({"id":7562825,"src":"2287_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7562825.html","width":130,"caption":"","height":87});
															thumbnails[7562826] = clik.newPhoto({"id":7562826,"src":"2218_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7562826.html","width":130,"caption":"","height":87});
															thumbnails[7562827] = clik.newPhoto({"id":7562827,"src":"2224_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7562827.html","width":130,"caption":"","height":87});
															thumbnails[7569729] = clik.newPhoto({"id":7569729,"src":"DSC2336_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7569729.html","width":130,"caption":"","height":87});
															thumbnails[7573925] = clik.newPhoto({"id":7573925,"src":"2130-zebra_thumb.jpg","galleries_id":410818,"server_id":32,"link":"photo_7573925.html","width":130,"caption":"","height":87});
															thumbnails[7573930] = clik.newPhoto({"id":7573930,"src":"DSC1712_thumb.jpg","galleries_id":410818,"server_id":32,"link":"photo_7573930.html","width":130,"caption":"","height":87});
															thumbnails[7573934] = clik.newPhoto({"id":7573934,"src":"1952-zebra_thumb.jpg","galleries_id":410818,"server_id":32,"link":"photo_7573934.html","width":130,"caption":"","height":87});
															thumbnails[7573938] = clik.newPhoto({"id":7573938,"src":"DSC1685_thumb.jpg","galleries_id":410818,"server_id":32,"link":"photo_7573938.html","width":130,"caption":"","height":87});
															thumbnails[7573941] = clik.newPhoto({"id":7573941,"src":"DSC1658_thumb.jpg","galleries_id":410818,"server_id":32,"link":"photo_7573941.html","width":130,"caption":"","height":196});
															thumbnails[7573950] = clik.newPhoto({"id":7573950,"src":"1913_thumb.jpg","galleries_id":410818,"server_id":32,"link":"photo_7573950.html","width":130,"caption":"","height":87});
															thumbnails[7650956] = clik.newPhoto({"id":7650956,"src":"_DSC1985_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7650956.html","width":130,"caption":"","height":195});
															thumbnails[7650957] = clik.newPhoto({"id":7650957,"src":"Ele-and-Kili_thumb.jpg","galleries_id":409833,"server_id":32,"link":"photo_7650957.html","width":130,"caption":"","height":73});
															thumbnails[7650959] = clik.newPhoto({"id":7650959,"src":"_DSC1592_thumb.jpg","galleries_id":410818,"server_id":32,"link":"photo_7650959.html","width":130,"caption":"","height":87});
															thumbnails[7651188] = clik.newPhoto({"id":7651188,"src":"_DSC2197_thumb.jpg","galleries_id":410818,"server_id":32,"link":"photo_7651188.html","width":130,"caption":"","height":93});
															thumbnails[9128525] = clik.newPhoto({"id":9128525,"src":"_DSC0228_1_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_9128525.html","width":130,"caption":"","height":87});
															thumbnails[9128526] = clik.newPhoto({"id":9128526,"src":"_DSC0243_1_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_9128526.html","width":130,"caption":"","height":87});
															thumbnails[9128527] = clik.newPhoto({"id":9128527,"src":"_DSC0252_1_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_9128527.html","width":130,"caption":"","height":87});
															thumbnails[9128743] = clik.newPhoto({"id":9128743,"src":"_DSC3266-anne-JPEG_1_thumb.jpg","galleries_id":381160,"server_id":32,"link":"photo_9128743.html","width":130,"caption":"Robin (Erithacus rubecula)","height":84});
															thumbnails[7044939] = clik.newPhoto({"id":7044939,"src":"PCAT1986_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7044939.html","width":130,"caption":"1986 Polecat","height":196});
															thumbnails[7085911] = clik.newPhoto({"id":7085911,"src":"Leopard-032_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7085911.html","width":130,"caption":"Amur leopard ","height":194});
															thumbnails[7085916] = clik.newPhoto({"id":7085916,"src":"Lemur-058_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7085916.html","width":130,"caption":"Ring tailed lemur with suckling baby","height":194});
															thumbnails[7085914] = clik.newPhoto({"id":7085914,"src":"Longleat-056_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7085914.html","width":130,"caption":"Otter","height":92});
															thumbnails[7044954] = clik.newPhoto({"id":7044954,"src":"L2517_thumb.jpg","galleries_id":381159,"server_id":32,"link":"photo_7044954.html","width":130,"caption":"2517 Lion","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[409833] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Elephants","link":"gallery_409833.html","maxRecords":0.0,"photoIDs":[7560883.0,7560887.0,7560888.0,7562818.0,7562820.0,7562821.0,7562823.0,7562825.0,7562826.0,7562827.0,7569729.0,7650956.0,7650957.0],"skipIndex":0,"section_code":"gallery","featured_images":"7650957,7650956,7569729,7562827,7562826,7562825,7562823,7562821,7562820,7562818","id":409833,"singleSection":false});				  						galleries[382993] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Floral gallery","link":"gallery_382993.html","maxRecords":0.0,"photoIDs":[7072944.0,7072945.0,7072947.0,7087036.0,7087080.0,7087093.0,7087100.0,7095279.0,7095286.0,7117802.0,7117808.0,7117809.0,7117810.0],"skipIndex":0,"section_code":"gallery","featured_images":"7117810,7117809,7117808,7117802,7095286,7095279,7087100,7087093,7087080,7087036","id":382993,"singleSection":false});				  						galleries[381159] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"For artists","link":"gallery_381159.html","maxRecords":0.0,"photoIDs":[7044947.0,7085888.0,7151185.0,7151188.0,7155185.0,7155192.0,7155198.0,7155200.0,7162705.0,7211241.0,7211243.0,7211245.0,9128525.0,9128526.0,9128527.0,7044939.0,7085911.0,7085916.0,7085914.0,7044954.0],"skipIndex":0,"section_code":"gallery","featured_images":"9128527,9128526,9128525,7211245,7211243,7211241,7162705,7155200,7155198,7155192","id":381159,"singleSection":false});				  						galleries[410818] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Kenya wildlife","link":"gallery_410818.html","maxRecords":0.0,"photoIDs":[7573925.0,7573930.0,7573934.0,7573938.0,7573941.0,7573950.0,7650959.0,7651188.0],"skipIndex":0,"section_code":"gallery","featured_images":"7651188,7650959,7573950,7573941,7573938,7573934,7573930,7573925","id":410818,"singleSection":false});				  						galleries[381160] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife gallery","link":"gallery_381160.html","maxRecords":0.0,"photoIDs":[7039915.0,7039918.0,7039919.0,7086107.0,7087123.0,7095296.0,7122384.0,7122403.0,7150935.0,7151009.0,7151202.0,9128743.0],"skipIndex":0,"section_code":"gallery","featured_images":"9128743,7151202,7151009,7150935,7122403,7122384,7095296,7087123,7086107,7039919","id":381160,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7573930,7562818,7039919,7039918';
imageSets[3] = '9128743,9128527,9128526,9128525,8654121,7700310,7700308,7700305,7651188,7650959,7650957,7650956,7573972,7573970,7573950,7573941,7573938,7573934,7573930,7573925,7569729,7562831,7562830,7562827,7562826,7562825,7562823,7562821,7562820,7562818,7560888,7560887,7560883,7323741,7323738,7323737,7320666,7320664,7278683,7267512,7267509,7211245,7211243,7211241,7200695,7162705,7155200,7155198,7155192,7155185';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/simonknightimages/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/simonknightimages/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 = 'Simon Knight : ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
	temp += this.fnGetPaymentInfo();
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp += '<p>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="SIMONKNIGHTIMAGES">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

