window.thumbnails = {};
															thumbnails[2841029] = clik.newPhoto({"id":2841029,"src":"bobphoto_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Robert Greenhalf with injured Barn Owl","height":164});
															thumbnails[2975344] = clik.newPhoto({"id":2975344,"src":"blackbirdswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975344.html","width":130,"caption":"Blackbirds<br>\r\n£60.00","height":158});
															thumbnails[2975346] = clik.newPhoto({"id":2975346,"src":"bluetitswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975346.html","width":130,"caption":"Blue Tits<br>\r\n£60.00","height":160});
															thumbnails[2975353] = clik.newPhoto({"id":2975353,"src":"bullfincheswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975353.html","width":130,"caption":"Bullfinches","height":141});
															thumbnails[2975354] = clik.newPhoto({"id":2975354,"src":"eveninglapwingswb_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_2975354.html","width":130,"caption":"Evening Lapwing","height":119});
															thumbnails[2975386] = clik.newPhoto({"id":2975386,"src":"goldfincheswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975386.html","width":130,"caption":"Goldfinches","height":152});
															thumbnails[2975394] = clik.newPhoto({"id":2975394,"src":"greenfincheswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975394.html","width":130,"caption":"Greenfinches","height":142});
															thumbnails[2975402] = clik.newPhoto({"id":2975402,"src":"jayswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975402.html","width":130,"caption":"Jays","height":141});
															thumbnails[2975404] = clik.newPhoto({"id":2975404,"src":"kingfisherwb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975404.html","width":130,"caption":"Kingfisher","height":156});
															thumbnails[2975407] = clik.newPhoto({"id":2975407,"src":"mimsmerememorieswb_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_2975407.html","width":130,"caption":"Minsmere Memories","height":130});
															thumbnails[2975443] = clik.newPhoto({"id":2975443,"src":"snipewb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975443.html","width":130,"caption":"Snipe<br>\r\n£60.00","height":157});
															thumbnails[2975459] = clik.newPhoto({"id":2975459,"src":"sparringpheasantswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975459.html","width":130,"caption":"Sparring Pheasants","height":142});
															thumbnails[5909829] = clik.newPhoto({"id":5909829,"src":"TurnstoneSmallWEB_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_5909829.html","width":130,"caption":"Turnstones","height":111});
															thumbnails[6132592] = clik.newPhoto({"id":6132592,"src":"Avocet_Reflections_72ppi_x_700_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6132592.html","width":130,"caption":"Avocet Reflections","height":109});
															thumbnails[6132623] = clik.newPhoto({"id":6132623,"src":"Bearded_Tits_72ppix_700_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_6132623.html","width":130,"caption":"Bearded Tits","height":288});
															thumbnails[6132648] = clik.newPhoto({"id":6132648,"src":"Cranes_72ppix_700_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6132648.html","width":130,"caption":"Cranes","height":108});
															thumbnails[6132650] = clik.newPhoto({"id":6132650,"src":"Fieldfares_72ppi_x700_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_6132650.html","width":130,"caption":"Winter Thrushes","height":274});
															thumbnails[6132651] = clik.newPhoto({"id":6132651,"src":"Fishing_Terns_72__thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_6132651.html","width":130,"caption":"Fishing Terns","height":286});
															thumbnails[6132652] = clik.newPhoto({"id":6132652,"src":"Flushed_Snipe_72ppi_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_6132652.html","width":130,"caption":"Flushed Snipe","height":299});
															thumbnails[6132653] = clik.newPhoto({"id":6132653,"src":"Garganey_72ppi_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6132653.html","width":130,"caption":"Gargany","height":131});
															thumbnails[6132655] = clik.newPhoto({"id":6132655,"src":"Great_Tits_72_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6132655.html","width":130,"caption":"Great Tits","height":129});
															thumbnails[6132657] = clik.newPhoto({"id":6132657,"src":"Little_Egrets_72_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6132657.html","width":130,"caption":"Little Egrets","height":131});
															thumbnails[6132660] = clik.newPhoto({"id":6132660,"src":"Pintails_72_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6132660.html","width":130,"caption":"Pintails","height":131});
															thumbnails[6132663] = clik.newPhoto({"id":6132663,"src":"Shelducks_72ppi_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6132663.html","width":130,"caption":"Shelducks","height":130});
															thumbnails[6132666] = clik.newPhoto({"id":6132666,"src":"Swallow_tails_72ppi_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_6132666.html","width":130,"caption":"Swallow tails","height":56});
															thumbnails[6132669] = clik.newPhoto({"id":6132669,"src":"Turnstones_72_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_6132669.html","width":130,"caption":"Turnstones","height":107});
															thumbnails[6132672] = clik.newPhoto({"id":6132672,"src":"Wigeon_72_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6132672.html","width":130,"caption":"Wigeon","height":109});
															thumbnails[6892834] = clik.newPhoto({"id":6892834,"src":"small_Bittern_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6892834.html","width":130,"caption":"Bittern","height":132});
															thumbnails[6892842] = clik.newPhoto({"id":6892842,"src":"small_Greenshank_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6892842.html","width":130,"caption":"Greenshank","height":132});
															thumbnails[6892845] = clik.newPhoto({"id":6892845,"src":"small_Little_Tern_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_6892845.html","width":130,"caption":"Little Tern","height":131});
															thumbnails[6892851] = clik.newPhoto({"id":6892851,"src":"small_Oystercatchers_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_6892851.html","width":130,"caption":"Oyster catchers","height":295});
															thumbnails[8777467] = clik.newPhoto({"id":8777467,"src":"Swanswb_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_8777467.html","width":130,"caption":"Whooper swans","height":131});
															thumbnails[2719023] = clik.newPhoto({"id":2719023,"src":"1bobwb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2719023.html","width":130,"caption":"Black-winged Stilts","height":318});
															thumbnails[2975428] = clik.newPhoto({"id":2975428,"src":"ringedploverswb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2975428.html","width":130,"caption":"Ringed Plovers","height":53});
															thumbnails[2975434] = clik.newPhoto({"id":2975434,"src":"sandwichternswb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2975434.html","width":130,"caption":"Sandwich Terns","height":54});
															thumbnails[2719220] = clik.newPhoto({"id":2719220,"src":"Grey Plovers_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2719220.html","width":130,"caption":"Grey Plovers","height":53});
															thumbnails[2719202] = clik.newPhoto({"id":2719202,"src":"Bewick's Swans & Pintails _thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2719202.html","width":130,"caption":"Bewick’s Swans and Pintails","height":55});
															thumbnails[2719136] = clik.newPhoto({"id":2719136,"src":"Tree Sparrows_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2719136.html","width":130,"caption":"Tree Sparrows","height":324});
															thumbnails[2708488] = clik.newPhoto({"id":2708488,"src":"SpoonbillsAvocetweb_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_2708488.html","width":130,"caption":"Spoonbills and Avocets","height":130});
															thumbnails[2719239] = clik.newPhoto({"id":2719239,"src":"Redshankswb1_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2719239.html","width":130,"caption":"Redshanks","height":306});
															thumbnails[2719134] = clik.newPhoto({"id":2719134,"src":"BlacktailedGodwitswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2719134.html","width":130,"caption":"Black-tailed Godwits","height":319});
															thumbnails[2708486] = clik.newPhoto({"id":2708486,"src":"partridgesswallowsweb_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_2708486.html","width":130,"caption":"Partridges and Swallows","height":141});
															thumbnails[2719187] = clik.newPhoto({"id":2719187,"src":"RedstartandWoodWarblerwb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2719187.html","width":130,"caption":"Redstart and Wood Warbler","height":54});
															thumbnails[2708484] = clik.newPhoto({"id":2708484,"src":"Gadwallsweb_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_2708484.html","width":130,"caption":"Gadwalls","height":129});
															thumbnails[2719243] = clik.newPhoto({"id":2719243,"src":"2wb1_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2719243.html","width":130,"caption":"Barn Owl","height":61});
															thumbnails[2975424] = clik.newPhoto({"id":2975424,"src":"redrumpedswallowswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975424.html","width":130,"caption":"Red-Rumped Swallows","height":310});
															thumbnails[2708485] = clik.newPhoto({"id":2708485,"src":"Lapwingsweb_thumb.jpg","galleries_id":171090,"server_id":32,"link":"photo_2708485.html","width":130,"caption":"Lapwings","height":130});
															thumbnails[2719273] = clik.newPhoto({"id":2719273,"src":"1wb2_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2719273.html","width":130,"caption":"Four Snipe<br>\r\nSORRY SOLD OUT","height":56});
															thumbnails[2975451] = clik.newPhoto({"id":2975451,"src":"snipeandbeardedtitswb_thumb.jpg","galleries_id":171089,"server_id":32,"link":"photo_2975451.html","width":130,"caption":"Snipe and Bearded Tits","height":320});
															thumbnails[2708487] = clik.newPhoto({"id":2708487,"src":"RooksHaresweb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2708487.html","width":130,"caption":"Hares and Rooks","height":115});
															thumbnails[2708489] = clik.newPhoto({"id":2708489,"src":"TealLapwingweb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2708489.html","width":130,"caption":"Teal and lapwing","height":117});
															thumbnails[2708481] = clik.newPhoto({"id":2708481,"src":"Avocetsweb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2708481.html","width":130,"caption":"Avocets<br>\r\nSORRY SOLD OUT","height":109});
															thumbnails[2975410] = clik.newPhoto({"id":2975410,"src":"Moorhenfamilywb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2975410.html","width":130,"caption":"Moorhen Family","height":119});
															thumbnails[2975360] = clik.newPhoto({"id":2975360,"src":"fieldfareswb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2975360.html","width":130,"caption":"Fieldfares","height":109});
															thumbnails[2822760] = clik.newPhoto({"id":2822760,"src":"youngswallowswb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2822760.html","width":130,"caption":"Young Swallows    ","height":115});
															thumbnails[2822743] = clik.newPhoto({"id":2822743,"src":"Brentsandcommongullswb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2822743.html","width":130,"caption":"Brents and Common Gulls ","height":112});
															thumbnails[2708482] = clik.newPhoto({"id":2708482,"src":"FlamingosAvocetsweb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2708482.html","width":130,"caption":"Flamingos and Avocets","height":109});
															thumbnails[2975384] = clik.newPhoto({"id":2975384,"src":"flotillawb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2975384.html","width":130,"caption":"Flotilla","height":114});
															thumbnails[2975462] = clik.newPhoto({"id":2975462,"src":"twoheronswb_thumb.jpg","galleries_id":171091,"server_id":32,"link":"photo_2975462.html","width":130,"caption":"Two Herons","height":119});
															thumbnails[2822742] = clik.newPhoto({"id":2822742,"src":"avocetfamilyweb_thumb.jpg","galleries_id":176155,"server_id":32,"link":"photo_2822742.html","width":130,"caption":"Avocet Family<br>\r\n£495.00 <br>\r\nSOLD","height":96});
															thumbnails[2822748] = clik.newPhoto({"id":2822748,"src":"garganeyandsandmartinswb_thumb.jpg","galleries_id":176155,"server_id":32,"link":"photo_2822748.html","width":130,"caption":"Garganey and Sand Martins <br>\r\n£560.00","height":108});
															thumbnails[2822751] = clik.newPhoto({"id":2822751,"src":"Lapwingwcwb_thumb.jpg","galleries_id":176155,"server_id":32,"link":"photo_2822751.html","width":130,"caption":"Lapwing<br>\r\n£495.00","height":96});
															thumbnails[2822752] = clik.newPhoto({"id":2822752,"src":"Le Hourdelwb_thumb.jpg","galleries_id":176155,"server_id":32,"link":"photo_2822752.html","width":130,"caption":"Le Hourdel<br>\r\n£450.00","height":95});
															thumbnails[2822759] = clik.newPhoto({"id":2822759,"src":"WhimbrelsandRabbitswb_thumb.jpg","galleries_id":176155,"server_id":32,"link":"photo_2822759.html","width":130,"caption":"Whimbrel and Rabbits<br>\r\n£450.00","height":97});
															thumbnails[2840623] = clik.newPhoto({"id":2840623,"src":"cranesflyinginwb_thumb.jpg","galleries_id":171088,"server_id":32,"link":"photo_2840623.html","width":130,"caption":"Cranes Flying In<br>\r\n£450.00<br>\r\nSOLD","height":130});
															thumbnails[2822744] = clik.newPhoto({"id":2822744,"src":"commonternsandblackheadedgullswb_thumb.jpg","galleries_id":171088,"server_id":32,"link":"photo_2822744.html","width":130,"caption":"Common Terns and Black-headed Gulls<br>\r\n£890.00 <br>\r\nSOLD","height":127});
															thumbnails[2822758] = clik.newPhoto({"id":2822758,"src":"treesparrowswb_thumb.jpg","galleries_id":171088,"server_id":32,"link":"photo_2822758.html","width":130,"caption":"Tree Sparrows<br>\r\n£990.00<br>\r\nSOLD","height":131});
															thumbnails[2822747] = clik.newPhoto({"id":2822747,"src":"cranesonstubblewb_thumb.jpg","galleries_id":171088,"server_id":32,"link":"photo_2822747.html","width":130,"caption":"Cranes on Stubble<br>\r\n£450.00 ","height":138});
															thumbnails[2822749] = clik.newPhoto({"id":2822749,"src":"godwitsavocetsheronandshelduckswb_thumb.jpg","galleries_id":171088,"server_id":32,"link":"photo_2822749.html","width":130,"caption":"Godwits, Avocets, Heron and Shelducks<br>\r\n£950.00 <br>\r\nSOLD","height":93});
															thumbnails[2822753] = clik.newPhoto({"id":2822753,"src":"oystercathersweb_thumb.jpg","galleries_id":171088,"server_id":32,"link":"photo_2822753.html","width":130,"caption":"Oystercatchers<br>\r\n£650.00","height":117});
															thumbnails[2822754] = clik.newPhoto({"id":2822754,"src":"sandwichternsandoystercatcherswb_thumb.jpg","galleries_id":171088,"server_id":32,"link":"photo_2822754.html","width":130,"caption":"Sandwich Terns and Oystercatchers <br>\r\nSOLD","height":85});
															thumbnails[2822745] = clik.newPhoto({"id":2822745,"src":"cranesatsunsetwb_thumb.jpg","galleries_id":171088,"server_id":32,"link":"photo_2822745.html","width":130,"caption":"Cranes at Sunset <br>\r\n£590.00","height":64});
															thumbnails[2822757] = clik.newPhoto({"id":2822757,"src":"tealwb_thumb.jpg","galleries_id":171088,"server_id":32,"link":"photo_2822757.html","width":130,"caption":"Teal<br>\r\n£650.00","height":73});
															thumbnails[2841040] = clik.newPhoto({"id":2841040,"src":"twobaysweb_thumb.jpg","galleries_id":176916,"server_id":32,"link":"photo_2841040.html","width":130,"caption":"Baie de Somme and Rye Bay","height":100});
															thumbnails[2841043] = clik.newPhoto({"id":2841043,"src":"towardsseaweb_thumb.jpg","galleries_id":176916,"server_id":32,"link":"photo_2841043.html","width":130,"caption":"Towards the Sea","height":96});
															thumbnails[2841056] = clik.newPhoto({"id":2841056,"src":"portraitmarshweb_thumb.jpg","galleries_id":176916,"server_id":32,"link":"photo_2841056.html","width":130,"caption":"Portrait of a Living Marsh","height":93});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[176916] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Books","link":"section213688.html","maxRecords":0.0,"photoIDs":[2841040.0,2841043.0,2841056.0],"skipIndex":0,"section_code":"section213688","featured_images":"2841056,2841043,2841040","id":176916,"singleSection":false});				  						galleries[171088] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Oils","link":"section213680.html","maxRecords":0.0,"photoIDs":[2840623.0,2822744.0,2822758.0,2822747.0,2822749.0,2822753.0,2822754.0,2822745.0,2822757.0],"skipIndex":0,"section_code":"section213680","featured_images":"2822747,2822744","id":171088,"singleSection":false});				  						galleries[176155] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Watercolours","link":"section213681.html","maxRecords":0.0,"photoIDs":[2822742.0,2822748.0,2822751.0,2822752.0,2822759.0],"skipIndex":0,"section_code":"section213681","featured_images":2822742.0,"id":176155,"singleSection":false});				  						galleries[171090] = clik.newGallery({"parentGallery":170685,"usePopups":false,"title":"Woodcuts Square","link":"gallery_171090.html","maxRecords":0.0,"photoIDs":[2975354.0,2975407.0,5909829.0,6132592.0,6132648.0,6132653.0,6132655.0,6132657.0,6132660.0,6132663.0,6132672.0,6892834.0,6892842.0,6892845.0,8777467.0,2708488.0,2708486.0,2708484.0,2708485.0],"skipIndex":0,"section_code":"gallery","featured_images":2708488.0,"id":171090,"singleSection":false});				  						galleries[171089] = clik.newGallery({"parentGallery":170685,"usePopups":false,"title":"Woodcuts portrait","link":"gallery_171089.html","maxRecords":0.0,"photoIDs":[2975344.0,2975346.0,2975353.0,2975386.0,2975394.0,2975402.0,2975404.0,2975443.0,2975459.0,6132623.0,6132650.0,6132651.0,6132652.0,6892851.0,2719023.0,2719136.0,2719239.0,2719134.0,2975424.0,2975451.0],"skipIndex":0,"section_code":"gallery","featured_images":"6892851,6132652,6132651,6132650,6132623,2975459,2975451,2975443,2975424,2975404","id":171089,"singleSection":false});				  						galleries[170685] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Woodcuts","link":"gallery_170685.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":2708488.0,"id":170685,"singleSection":false});				  						galleries[171091] = clik.newGallery({"parentGallery":170685,"usePopups":false,"title":"Woodcuts landscape","link":"gallery_171091.html","maxRecords":0.0,"photoIDs":[6132666.0,6132669.0,2975428.0,2975434.0,2719220.0,2719202.0,2719187.0,2719243.0,2719273.0,2708487.0,2708489.0,2708481.0,2975410.0,2975360.0,2822760.0,2822743.0,2708482.0,2975384.0,2975462.0],"skipIndex":0,"section_code":"gallery","featured_images":"6132669,6132666,2975462,2975434,2975428,2975410,2975384,2975360,2822760,2822743","id":171091,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '2822744';
imageSets[2] = '2822742,2822744,2708488,2822747';
imageSets[3] = '8777467,6892851,6892845,6892842,6892834,6132672,6132669,6132666,6132663,6132660,6132657,6132655,6132653,6132652,6132651,6132650,6132648,6132623,6132592,5909829,2975462,2975459,2975451,2975443,2975434,2975428,2975424,2975410,2975407,2975404,2975402,2975394,2975386,2975384,2975360,2975354,2975353,2975346,2975344,2841056,2841043,2841040,2841029,2840623,2822760,2822759,2822758,2822757,2822754,2822753';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/BobGreenhalf/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/BobGreenhalf/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 = 'Robert Greenhalf Artist: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '' || 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;
	}
}

			

