window.thumbnails = {};
															thumbnails[3316668] = clik.newPhoto({"id":3316668,"src":"cowspoppies copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3316668.html","width":130,"caption":"Cows wending their way through poppy fields at Birling Gap on the South Downs","height":87});
															thumbnails[3316696] = clik.newPhoto({"id":3316696,"src":"Pagham Harbour copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3316696.html","width":130,"caption":"Bird migration at Pagham Harbour","height":81});
															thumbnails[3316705] = clik.newPhoto({"id":3316705,"src":"storm palace pier_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3316705.html","width":130,"caption":"Wave crashes over Palace Pier","height":92});
															thumbnails[3320258] = clik.newPhoto({"id":3320258,"src":"leaping deer_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3320258.html","width":130,"caption":"Startled deer out of cover in Cowfold","height":85});
															thumbnails[3320276] = clik.newPhoto({"id":3320276,"src":"westrpier at night copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3320276.html","width":130,"caption":"Last  picture taken of the West Pier at night before it collapsed","height":91});
															thumbnails[3320324] = clik.newPhoto({"id":3320324,"src":"beech leaves_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3320324.html","width":130,"caption":"Autumn Beech trees on the North Downs","height":87});
															thumbnails[3320370] = clik.newPhoto({"id":3320370,"src":"newhaven storm copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3320370.html","width":130,"caption":"Newhaven storm","height":84});
															thumbnails[3320460] = clik.newPhoto({"id":3320460,"src":"winter berries copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3320460.html","width":130,"caption":"Winter berries in West Grinstead woods","height":87});
															thumbnails[3320611] = clik.newPhoto({"id":3320611,"src":"CORNWALL hut_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3320611.html","width":130,"caption":"Atlantic storm hits fishermans hut at Cape Cornwall","height":93});
															thumbnails[3320654] = clik.newPhoto({"id":3320654,"src":"BEACHYHEAD LIGHTHOUSE copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3320654.html","width":130,"caption":"Silvery waters with Belle Toute Lighthouse","height":83});
															thumbnails[3331187] = clik.newPhoto({"id":3331187,"src":"starlings1_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3331187.html","width":130,"caption":"Starlings silhouetted over West Pier at sunset","height":87});
															thumbnails[3331636] = clik.newPhoto({"id":3331636,"src":"Atlatic roller_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3331636.html","width":130,"caption":"Atlantic roller gathers momentum at Cape Cornwall","height":87});
															thumbnails[3331669] = clik.newPhoto({"id":3331669,"src":"coloured sky copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3331669.html","width":130,"caption":"Coloured skies over Cowfold","height":86});
															thumbnails[3331703] = clik.newPhoto({"id":3331703,"src":"deerfrontfield_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3331703.html","width":130,"caption":"Deer run wild in West Grinstead","height":90});
															thumbnails[3331883] = clik.newPhoto({"id":3331883,"src":"jersey-steps_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3331883.html","width":130,"caption":"Harbour steps at Bonne Nuit Bay, Jersey","height":95});
															thumbnails[3331919] = clik.newPhoto({"id":3331919,"src":"jersey-crabpots_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3331919.html","width":130,"caption":"Crabpots at Bonne Nuit Bay, Jersey","height":94});
															thumbnails[3332204] = clik.newPhoto({"id":3332204,"src":"weyarun narrowboats_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3332204.html","width":130,"caption":"Narrowboats at Loxwood on the Wey-Arun Canal, West Sussex","height":88});
															thumbnails[3332247] = clik.newPhoto({"id":3332247,"src":"WORTHING copy1_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3332247.html","width":130,"caption":"Golden sunset at low tide, Worthing","height":87});
															thumbnails[3332269] = clik.newPhoto({"id":3332269,"src":"WEEPSILVERBIRCH copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3332269.html","width":130,"caption":"Snow swept Weeping Silver Birch in spring, West Grinstead","height":87});
															thumbnails[3335435] = clik.newPhoto({"id":3335435,"src":"highanddry copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3335435.html","width":130,"caption":"High and Dry St Mary's Bay, Romney Marsh","height":84});
															thumbnails[3336305] = clik.newPhoto({"id":3336305,"src":"FROST copy5_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3336305.html","width":130,"caption":"A crisp early winters morning on the River Adur","height":191});
															thumbnails[3336355] = clik.newPhoto({"id":3336355,"src":"reflections copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3336355.html","width":130,"caption":"Reflections on the Wey-Arun Canal","height":185});
															thumbnails[3336470] = clik.newPhoto({"id":3336470,"src":"sunrise copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3336470.html","width":130,"caption":"Sunrise reflects across a calm Cornish sea off St. Ives","height":201});
															thumbnails[3336132] = clik.newPhoto({"id":3336132,"src":"jersey-chains_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3336132.html","width":130,"caption":"Boat chains in Bonne Nuit Harbour, Jersey","height":173});
															thumbnails[3340195] = clik.newPhoto({"id":3340195,"src":"north downs-3 copy5_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3340195.html","width":130,"caption":"Beech trees in autumn on the North Downs ","height":195});
															thumbnails[3320540] = clik.newPhoto({"id":3320540,"src":"sunset over pier1_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3320540.html","width":130,"caption":"High summer sunset over West Pier","height":101});
															thumbnails[3320507] = clik.newPhoto({"id":3320507,"src":"CORNWALLcaperocks_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3320507.html","width":130,"caption":"Retreating tide over rocks at Cape Cornwall","height":85});
															thumbnails[3336576] = clik.newPhoto({"id":3336576,"src":"sunrise-2 copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3336576.html","width":130,"caption":"Sunrise reflects on a calm Cornish sea off St. Ives","height":194});
															thumbnails[3331745] = clik.newPhoto({"id":3331745,"src":"Autumn-seeds_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3331745.html","width":130,"caption":"Autumn wild seeds along the Wey-Arun Canal","height":89});
															thumbnails[3332396] = clik.newPhoto({"id":3332396,"src":"rain drops copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3332396.html","width":130,"caption":"Raindrops in Maplehurst wood","height":87});
															thumbnails[3331382] = clik.newPhoto({"id":3331382,"src":"SNOWARUNDELCASTLE copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3331382.html","width":130,"caption":"Arundel Castle in the snow","height":84});
															thumbnails[3320734] = clik.newPhoto({"id":3320734,"src":"bosham-1 copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3320734.html","width":130,"caption":"Yacht returns to Bosham at dusk","height":87});
															thumbnails[3392492] = clik.newPhoto({"id":3392492,"src":"arches_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3392492.html","width":130,"caption":"Victorian arches at Brighton East Sussex ","height":87});
															thumbnails[3339837] = clik.newPhoto({"id":3339837,"src":"mayfly3 copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3339837.html","width":130,"caption":"Mayfly","height":56});
															thumbnails[3344061] = clik.newPhoto({"id":3344061,"src":"cottages sevensisters_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3344061.html","width":130,"caption":"A room with a view at Cookmere Haven flanked by the Seven Sisters","height":87});
															thumbnails[3343958] = clik.newPhoto({"id":3343958,"src":"newforest pony copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3343958.html","width":130,"caption":"New Forest pony","height":90});
															thumbnails[3965013] = clik.newPhoto({"id":3965013,"src":"Woodland_ponds_at_Lamorna_thumb.jpg","galleries_id":192249,"server_id":37,"link":"photo_3965013.html","width":160,"caption":"Woodland ponds at Lamorna Cove","height":106});
															thumbnails[3340174] = clik.newPhoto({"id":3340174,"src":"fishnet huts-2 copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3340174.html","width":130,"caption":"The blackened fishermans' huts stand tall on Hastings beach","height":188});
															thumbnails[3340187] = clik.newPhoto({"id":3340187,"src":"fishnet huts copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3340187.html","width":130,"caption":"The blackened fishermans' huts stand proud against the cliffs at Hastings beach","height":87});
															thumbnails[3335967] = clik.newPhoto({"id":3335967,"src":"beachy head-4 copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3335967.html","width":130,"caption":"Beachy Head Lighthouse","height":86});
															thumbnails[3336036] = clik.newPhoto({"id":3336036,"src":"CORNWALL-waterfall_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3336036.html","width":130,"caption":"Waterfall at Lamorna Cove, Cornwall","height":87});
															thumbnails[3965011] = clik.newPhoto({"id":3965011,"src":"FERN_STREAM_CORNWALL1_thumb.jpg","galleries_id":192249,"server_id":37,"link":"photo_3965011.html","width":160,"caption":"Woodland waterfall at Lamorna Cove","height":223});
															thumbnails[3336072] = clik.newPhoto({"id":3336072,"src":"pagham taking flight_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3336072.html","width":130,"caption":"Taking flight in Pagham Harbour","height":76});
															thumbnails[3335861] = clik.newPhoto({"id":3335861,"src":"Arun-castle wideangle_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3335861.html","width":130,"caption":"Arundel Castle","height":86});
															thumbnails[3335687] = clik.newPhoto({"id":3335687,"src":"SHIPLEY MILL copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3335687.html","width":130,"caption":"Shipley Mill 'Home of Jonathon Creek'","height":87});
															thumbnails[3335733] = clik.newPhoto({"id":3335733,"src":"roots copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3335733.html","width":130,"caption":"Roots, Chantonbury Ring","height":80});
															thumbnails[3335446] = clik.newPhoto({"id":3335446,"src":"highanddry-3 copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3335446.html","width":130,"caption":"Beached at St. Mary's Bay, Romney Marsh","height":83});
															thumbnails[3335542] = clik.newPhoto({"id":3335542,"src":"WEY-ARUN-trees_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3335542.html","width":130,"caption":"Wey-Arun Canal at Loxwood","height":87});
															thumbnails[3335581] = clik.newPhoto({"id":3335581,"src":"SWAN-BREAD copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3335581.html","width":130,"caption":"Hungry swan on the River Thames at Windsor","height":92});
															thumbnails[3331942] = clik.newPhoto({"id":3331942,"src":"MOORHEN copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3331942.html","width":130,"caption":"Moorhen raises her chicks in the middle of the River Thames near Windsor","height":92});
															thumbnails[5493534] = clik.newPhoto({"id":5493534,"src":"WINDSORSWANS2a_edited-11_thumb.jpg","galleries_id":192248,"server_id":37,"link":"photo_5493534.html","width":160,"caption":"Queen's swans touch down on the River Thames at Windsor Castle","height":109});
															thumbnails[3332045] = clik.newPhoto({"id":3332045,"src":"winter berries-2_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3332045.html","width":130,"caption":"More winter berries in West Grinstead woods","height":86});
															thumbnails[3331254] = clik.newPhoto({"id":3331254,"src":"arun-castlearun_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3331254.html","width":130,"caption":"Arundel Castle stands proudly over the River Arun","height":86});
															thumbnails[3335646] = clik.newPhoto({"id":3335646,"src":"silverbirch wood_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3335646.html","width":130,"caption":"A Silverbirch wood at Pulborough West Sussex","height":87});
															thumbnails[3335769] = clik.newPhoto({"id":3335769,"src":"fishboatnewhaven copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3335769.html","width":130,"caption":"Coming Home, Newhaven Harbour","height":83});
															thumbnails[3335924] = clik.newPhoto({"id":3335924,"src":"winter trees copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3335924.html","width":130,"caption":"Winter Trees, West Sussex","height":87});
															thumbnails[3339888] = clik.newPhoto({"id":3339888,"src":"viaduct-train copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3339888.html","width":130,"caption":"Train speeds across the Balcombe Viaduct","height":83});
															thumbnails[3339921] = clik.newPhoto({"id":3339921,"src":"broken pier copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3339921.html","width":130,"caption":"First light the morning after the collapse of West Pier Brighton","height":79});
															thumbnails[3339964] = clik.newPhoto({"id":3339964,"src":"BLUEBELLS copy1_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3339964.html","width":130,"caption":"Bluebell wood in Cowfold","height":87});
															thumbnails[3343886] = clik.newPhoto({"id":3343886,"src":"sunrisechichester copy2_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3343886.html","width":130,"caption":"Sun rise over a misty Chichester Harbour","height":96});
															thumbnails[3343906] = clik.newPhoto({"id":3343906,"src":"ducks_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3343906.html","width":130,"caption":"Ducks march across the ice at Slaugham Ponds","height":79});
															thumbnails[3344040] = clik.newPhoto({"id":3344040,"src":"stormbeach copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3344040.html","width":130,"caption":"Braving the tempest in Brighton","height":86});
															thumbnails[3344073] = clik.newPhoto({"id":3344073,"src":"two boats copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3344073.html","width":130,"caption":"Aground at Dungeness","height":82});
															thumbnails[3331428] = clik.newPhoto({"id":3331428,"src":"Dartmouth copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3331428.html","width":130,"caption":"The Royal Naval College overlooking the River Dart at Dartmouth","height":87});
															thumbnails[3331553] = clik.newPhoto({"id":3331553,"src":"Dartmouth-train_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3331553.html","width":130,"caption":"The Dart Valley Railway steam train chugs gently along the River Dart","height":88});
															thumbnails[3320713] = clik.newPhoto({"id":3320713,"src":"bosham-fields_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3320713.html","width":130,"caption":"Golden fields at Bosham","height":87});
															thumbnails[3335490] = clik.newPhoto({"id":3335490,"src":"highanddry-2 copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3335490.html","width":130,"caption":"High and Dry St. Mary's Bay, Romney Marsh","height":87});
															thumbnails[3964965] = clik.newPhoto({"id":3964965,"src":"FUNGI1_edited-1_thumb.jpg","galleries_id":192249,"server_id":37,"link":"photo_3964965.html","width":160,"caption":"Fungi study","height":93});
															thumbnails[3428775] = clik.newPhoto({"id":3428775,"src":"moss copy_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_3428775.html","width":130,"caption":"Light on moss, Goodwood","height":83});
															thumbnails[3965009] = clik.newPhoto({"id":3965009,"src":"ARTISTIC_TREE_CORNWALL_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3965009.html","width":130,"caption":"Captivating tree in Lamorna woods","height":135});
															thumbnails[3964974] = clik.newPhoto({"id":3964974,"src":"WILDFLOWERS_LAMORNA_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_3964974.html","width":130,"caption":"Cliffs at Lamorna Cove","height":90});
															thumbnails[5358703] = clik.newPhoto({"id":5358703,"src":"Robin_in_flight_copy_copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_5358703.html","width":130,"caption":"Robin in snow flight, West Grinstead, West Sussex","height":202});
															thumbnails[5358704] = clik.newPhoto({"id":5358704,"src":"snow_forest_wood_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_5358704.html","width":130,"caption":"Snow woods at Sedgewick West Sussex","height":86});
															thumbnails[5358706] = clik.newPhoto({"id":5358706,"src":"Robin_on_lampost_copy_copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_5358706.html","width":130,"caption":"Robin landing, West Grinstead","height":89});
															thumbnails[5358748] = clik.newPhoto({"id":5358748,"src":"Pig_on_ice_copy_edited-1_thumb.jpg","galleries_id":192249,"server_id":5,"link":"photo_5358748.html","width":130,"caption":"Piglet on ice, Monks Gate West Sussex","height":87});
															thumbnails[5358732] = clik.newPhoto({"id":5358732,"src":"christmas_card_robin_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_5358732.html","width":130,"caption":"Christmas card robin, West Grinstead","height":94});
															thumbnails[3964956] = clik.newPhoto({"id":3964956,"src":"Riding_hard_at_cobo_thumb.jpg","galleries_id":192249,"server_id":37,"link":"photo_3964956.html","width":160,"caption":"Riding hard Cobo Beach Guernsey","height":109});
															thumbnails[5484877] = clik.newPhoto({"id":5484877,"src":"pony1_edited-2_copy_thumb.jpg","galleries_id":192248,"server_id":5,"link":"photo_5484877.html","width":130,"caption":"New Forest ponies in the mist","height":90});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[192248] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1","link":"gallery_192248.html","maxRecords":0.0,"photoIDs":[3316668.0,3316696.0,3316705.0,3320258.0,3320276.0,3320324.0,3320370.0,3320460.0,3320611.0,3320654.0,3331187.0,3331636.0,3331669.0,3331703.0,3331883.0,3331919.0,3332204.0,3332247.0,3332269.0,3335435.0,3336305.0,3336355.0,3336470.0,3336132.0,3340195.0,5493534.0,3335646.0,3335769.0,3335924.0,3339888.0,3339921.0,3339964.0,3343886.0,3343906.0,3344040.0,3344073.0,3965009.0,3964974.0,5358703.0,5358706.0,5358732.0,5484877.0],"skipIndex":0,"section_code":"gallery","featured_images":3316668.0,"id":192248,"singleSection":false});				  						galleries[192249] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 2","link":"gallery_192249.html","maxRecords":0.0,"photoIDs":[3320540.0,3320507.0,3336576.0,3331745.0,3332396.0,3331382.0,3320734.0,3392492.0,3339837.0,3344061.0,3343958.0,3965013.0,3340174.0,3340187.0,3335967.0,3336036.0,3965011.0,3336072.0,3335861.0,3335687.0,3335733.0,3335446.0,3335542.0,3335581.0,3331942.0,3332045.0,3331254.0,3331428.0,3331553.0,3320713.0,3335490.0,3964965.0,3428775.0,5358704.0,5358748.0,3964956.0],"skipIndex":0,"section_code":"gallery","featured_images":3320540.0,"id":192249,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3316668';
imageSets[2] = '3320540,3316668';
imageSets[3] = '5493534,5484877,5358748,5358732,5358706,5358704,5358703,3965013,3965011,3965009,3964974,3964965,3964956,3428775,3392492,3344073,3344061,3344040,3343958,3343906,3343886,3340195,3340187,3340174,3339964,3339921,3339888,3339837,3336576,3336470,3336355,3336305,3336132,3336072,3336036,3335967,3335924,3335861,3335769,3335733,3335687,3335646,3335581,3335542,3335490,3335446,3335435,3332396,3332269,3332247';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/gerrypenny/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/gerrypenny/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 = 'southcoastgallery: ' + 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>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="GERRYPENNY">';
			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;
	}
}

			

