window.thumbnails = new Object();
												thumbnails[4731930] = new thumbnail(4731930,'','Carina Hall','me_thumb.jpg',130, 193,18,'															#');
												thumbnails[4797140] = new thumbnail(4797140,'','','framedcoral_sml_thumb.jpg',130, 98,18,'															#');
												thumbnails[4797142] = new thumbnail(4797142,'','','framedseascapes_sml_thumb.jpg',130, 63,18,'															#');
												thumbnails[5968602] = new thumbnail(5968602,'','','pink_sunset_borneo_thumb.jpg',130, 87,18,'															#');
												thumbnails[6044241] = new thumbnail(6044241,'','','coral_reef_reefscape_carina_hall_thumb.jpg',130, 91,18,'															#');
												thumbnails[6152382] = new thumbnail(6152382,'','','bikes_mallorca_pollensa_thumb.jpg',130, 98,18,'															#');
												thumbnails[6461709] = new thumbnail(6461709,'','Cul Beag - Western Highlands, Scotland','scotland21_thumb.jpg',130, 87,18,'															#');
												thumbnails[6583320] = new thumbnail(6583320,'','','mountain_pondsml1_thumb.jpg',130, 87,18,'															#');
												thumbnails[4783132] = new thumbnail(4783132,'','Garibaldi - Catalina Island, California','Garibaldi_7_thumb.jpg',130, 98,18,'															#');
												thumbnails[4433928] = new thumbnail(4433928,'259373','A Friend -  Hawksbill Turtle swimming at Turtle Patch, Sipadan, Borneo','Hawksbill_Turtle_1_thumb.jpg',130, 98,18,'																			photo_4433928.html');
												thumbnails[4449381] = new thumbnail(4449381,'259373','Reefscape - Coral Reefscape at Sha\'ab Marsa Alam, The Red Sea','Coral_Reefscape1_thumb.jpg',130, 95,18,'																			photo_4449381.html');
												thumbnails[4449387] = new thumbnail(4449387,'259373','Red Gorgonian & Sea Whip - The Maldives','seafans__whip_thumb.jpg',130, 93,18,'																			photo_4449387.html');
												thumbnails[4449388] = new thumbnail(4449388,'259373','Blue Stripped Snappers with scuba diver - Brissare Rocks, The Seychelles','bev_snapper_edit_2_thumb.jpg',130, 95,18,'																			photo_4449388.html');
												thumbnails[4449390] = new thumbnail(4449390,'259373','Reefscape - scuba diver diving on a coral reef, The Red Sea','reefanddiver_thumb.jpg',130, 98,18,'																			photo_4449390.html');
												thumbnails[4449391] = new thumbnail(4449391,'259373','My Sipadan friend, a Hawksbill turtle at Hanging Garden Coral reef, Borneo','Turtle_up_close_1123_thumb.jpg',130, 98,18,'																			photo_4449391.html');
												thumbnails[4449542] = new thumbnail(4449542,'259373','Little Hawksbill with Maggie - Sipadan, Borneo','Maggie_and_turtle_1_thumb.jpg',130, 98,18,'																			photo_4449542.html');
												thumbnails[4449561] = new thumbnail(4449561,'259373','Whale Shark & Scuba diver - North West Mahe, Conservation project in The Seychelles','whale_shark_4_editbw_thumb.jpg',130, 95,18,'																			photo_4449561.html');
												thumbnails[4449569] = new thumbnail(4449569,'259373','Temple reef with scuba diver - Sharm El Sheikh, The Red Sea','maggiediving_thumb.jpg',130, 195,18,'																			photo_4449569.html');
												thumbnails[4449574] = new thumbnail(4449574,'259373','Pink Gorgonian reef - Ari Atoll, The Maldives','Seafan_11_thumb.jpg',130, 173,18,'																			photo_4449574.html');
												thumbnails[4449577] = new thumbnail(4449577,'259373','Hawksbill Shell - Turtle Patch reef, Sipadan, Borneo','Shell_turtle_11_thumb.jpg',130, 185,18,'																			photo_4449577.html');
												thumbnails[4449580] = new thumbnail(4449580,'259373','Feather Star - Coral Reef near Si Amil Island, Borneo','Sea_Feather_and_Diver_11_thumb.jpg',130, 173,18,'																			photo_4449580.html');
												thumbnails[4533268] = new thumbnail(4533268,'263276','Sacre Coeur - Paris, France','Sacre_Coeur_thumb.jpg',130, 173,18,'																			photo_4533268.html');
												thumbnails[4533281] = new thumbnail(4533281,'263276','Clifton Suspension Bridge & Balloons, Bristol','balloons9_thumb.jpg',130, 95,18,'																			photo_4533281.html');
												thumbnails[4585431] = new thumbnail(4585431,'265575','Pink Iris detail - Mum\'s house','iris_01_thumb.jpg',130, 82,18,'																			photo_4585431.html');
												thumbnails[4585433] = new thumbnail(4585433,'265575','Orchid - Mum\'s house','iris_02_thumb.jpg',130, 82,18,'																			photo_4585433.html');
												thumbnails[4605920] = new thumbnail(4605920,'263276','Le Corbusier\'s chapel at Ronchamp','Ronchoump_1_thumb.jpg',130, 98,18,'																			photo_4605920.html');
												thumbnails[4607628] = new thumbnail(4607628,'265575','Curly Whirly Twig - Sepilok, Borneo','Curly_whirly_twig_thumb.jpg',130, 87,18,'																			photo_4607628.html');
												thumbnails[4611582] = new thumbnail(4611582,'263275','Richmond Park reflection - Richmond upon Thames, England','Richmond_Park_bridge_reflection_thumb.jpg',130, 87,18,'																			photo_4611582.html');
												thumbnails[4611627] = new thumbnail(4611627,'263276','Prgaue arch view - Prague','Prague_2_thumb.jpg',130, 173,18,'																			photo_4611627.html');
												thumbnails[4729197] = new thumbnail(4729197,'263275','Moody day - The River Wey, Surrey, England','riverwey_thumb.jpg',130, 87,18,'																			photo_4729197.html');
												thumbnails[5409022] = new thumbnail(5409022,'263273','Enchanted Pony, The New Forest','white_pony_thumb.jpg',130, 87,18,'																			photo_5409022.html');
												thumbnails[5409083] = new thumbnail(5409083,'259373','Big blue beauty, Whale Shark, The Seychelles','whaleshark_thumb.jpg',130, 87,18,'																			photo_5409083.html');
												thumbnails[5959265] = new thumbnail(5959265,'265575','Sun lit Tulips - Oxford Botanical Gardens','tulips_thumb.jpg',130, 87,18,'																			photo_5959265.html');
												thumbnails[6055088] = new thumbnail(6055088,'259373','Whale Shark in sun light - The Seychelles','whale_shark_seychelles_thumb.jpg',130, 173,18,'																			photo_6055088.html');
												thumbnails[6055089] = new thumbnail(6055089,'259373','Whale Shark - The Seychelles','whale_shark_seychelles_mahe_thumb.jpg',130, 87,18,'																			photo_6055089.html');
												thumbnails[6055091] = new thumbnail(6055091,'259373','Lionfish & Scuba diver - Oman','lionfish_oman_diver_thumb.jpg',130, 195,18,'																			photo_6055091.html');
												thumbnails[6055142] = new thumbnail(6055142,'263273','Oranutan - Sepilok, Borneo','oranutan_borneo_sepilok1_thumb.jpg',130, 87,18,'																			photo_6055142.html');
												thumbnails[6995879] = new thumbnail(6995879,'265575','Autumn leaves','autumn24_copy_thumb.jpg',130, 87,18,'																			photo_6995879.html');
												thumbnails[6995883] = new thumbnail(6995883,'263275','Colouring Autumn','autumn32_copy_thumb.jpg',130, 87,18,'																			photo_6995883.html');
												thumbnails[6995886] = new thumbnail(6995886,'263275','Riverside reflection','autumn37_copy_thumb.jpg',130, 194,18,'																			photo_6995886.html');
												thumbnails[7245209] = new thumbnail(7245209,'263273','Snow Sheep','sheep_snow_thumb.jpg',130, 87,18,'																			photo_7245209.html');
												thumbnails[7245218] = new thumbnail(7245218,'263275','Snow scene','snow_tree_thumb.jpg',130, 87,18,'																			photo_7245218.html');
												thumbnails[4585179] = new thumbnail(4585179,'265575','Purple Tulips 1 - Brockwell Park, Brixton, England','purpleflower1_thumb.jpg',130, 87,18,'																			photo_4585179.html');
												thumbnails[4585217] = new thumbnail(4585217,'265598','Water Village - Sandakan, Borneo','DSC_0626_thumb.jpg',130, 87,18,'																			photo_4585217.html');
												thumbnails[4605924] = new thumbnail(4605924,'263275','Bay near St Brides - Pembrokeshire, Wales','boat2_thumb.jpg',130, 87,18,'																			photo_4605924.html');
												thumbnails[4607633] = new thumbnail(4607633,'259374','Silhouette boy - Beau Vallon, The Seychelles','seychelle_boy0_thumb.jpg',130, 87,18,'																			photo_4607633.html');
												thumbnails[4985450] = new thumbnail(4985450,'265598','Lesson in diving! Yadua Village School, Fiji','fiji1_thumb.jpg',130, 83,18,'																			photo_4985450.html');
												thumbnails[4533540] = new thumbnail(4533540,'259374','Driftwood island, The Maldives','treemaldives4_thumb.jpg',130, 87,18,'																			photo_4533540.html');
												thumbnails[4585181] = new thumbnail(4585181,'265575','Yellow Daisy 2 - Brockwell Park, Brixton, England','yellowflower3_thumb.jpg',130, 87,18,'																			photo_4585181.html');
												thumbnails[4585350] = new thumbnail(4585350,'263275','Clapham Common pond - London, England','clap_common_2_thumb.jpg',130, 87,18,'																			photo_4585350.html');
												thumbnails[4585479] = new thumbnail(4585479,'265598','Dancing boy - The Submarine Base, Rabaul, Papua New Guinea','dancingPapuaNewGuinea_thumb.jpg',130, 81,18,'																			photo_4585479.html');
												thumbnails[4533258] = new thumbnail(4533258,'263275','Richmond Hill - Richmond upon Thames, England','Richmond_Hill1_thumb.jpg',130, 98,18,'																			photo_4533258.html');
												thumbnails[4533618] = new thumbnail(4533618,'259374','Turquoise Thunder - The Maldives','Maldives_storm_1_thumb.jpg',130, 87,18,'																			photo_4533618.html');
												thumbnails[4585176] = new thumbnail(4585176,'265575','Ready to burst - Brockwell Park, Brixton, England','bud1_thumb.jpg',130, 87,18,'																			photo_4585176.html');
												thumbnails[4606007] = new thumbnail(4606007,'265598','Fish Market - Victoria, The Seychelles','thedeal_thumb.jpg',130, 87,18,'																			photo_4606007.html');
												thumbnails[4449701] = new thumbnail(4449701,'259374','Still Blue - Celebes Sea, Borneo','Celebes_Sea_2_thumb.jpg',130, 86,18,'																			photo_4449701.html');
												thumbnails[4449705] = new thumbnail(4449705,'263275','Still dawn 1 - Kinabatangan river, Sukau, Borneo','Kinabatangan_sunrise_2_thumb.jpg',130, 87,18,'																			photo_4449705.html');
												thumbnails[4585119] = new thumbnail(4585119,'263273','Foddies gathering - The Seychelles','Foddies_thumb.jpg',130, 87,18,'																			photo_4585119.html');
												thumbnails[4533172] = new thumbnail(4533172,'263273','Prehistoric Smile - Giant Tortoise, Curieuse Island, The Seychelles','Tortoise_1_thumb.jpg',130, 87,18,'																			photo_4533172.html');
												thumbnails[4585249] = new thumbnail(4585249,'265575','Dancing Anthers - Sepilok, Borneo','dancing_anthers_thumb.jpg',130, 194,18,'																			photo_4585249.html');
												thumbnails[4657794] = new thumbnail(4657794,'265598','Sailfish, a sad sight - Rabaul, Papua New Guinea','Sailfish2_thumb.jpg',130, 170,18,'																			photo_4657794.html');
												thumbnails[4770339] = new thumbnail(4770339,'265598','Water Village 2 - Sandakan, Borneo','borneo5_thumb.jpg',130, 87,18,'																			photo_4770339.html');
												thumbnails[4796048] = new thumbnail(4796048,'263276','St Pauls Cathedral - London','spitalfields5_thumb.jpg',130, 87,18,'																			photo_4796048.html');
												thumbnails[5960039] = new thumbnail(5960039,'263273','Bay Forest Pony - The New Forest','pony20_thumb.jpg',130, 195,18,'																			photo_5960039.html');
												thumbnails[4533122] = new thumbnail(4533122,'263273','Tern - Aride island, The Seychelles','Tern_thumb.jpg',130, 194,18,'																			photo_4533122.html');
												thumbnails[4584905] = new thumbnail(4584905,'259374','Grand Anse beach - La Digue, The Seychelles','la_digue2_thumb.jpg',130, 195,18,'																			photo_4584905.html');
												thumbnails[4584924] = new thumbnail(4584924,'265575','Yellow Daisy 1 - Brockwell Park, Brixton, England','yellowflower1_thumb.jpg',130, 194,18,'																			photo_4584924.html');
												thumbnails[4613218] = new thumbnail(4613218,'263276','60 miles offshore- Daedalus Lighthouse, South Red Sea','Daedalus_lighthouse_The_Red_Sea_thumb.jpg',130, 202,18,'																			photo_4613218.html');
												thumbnails[4985470] = new thumbnail(4985470,'265598','\'Save Yadua\'s Coral Reefs\' Yadua Village School - Fiji','fiji2_thumb.jpg',130, 85,18,'																			photo_4985470.html');
												thumbnails[4584915] = new thumbnail(4584915,'259374','Pastel Sunset - Beau Vallon beach, The Seychelles','purplesun_thumb.jpg',130, 173,18,'																			photo_4584915.html');
												thumbnails[4533072] = new thumbnail(4533072,'263273','Velvet Nose - The New Forest','newforestpony_thumb.jpg',130, 173,18,'																			photo_4533072.html');
												thumbnails[4585123] = new thumbnail(4585123,'259374','Driftwood at Grand Anse - La Digue, The Seychelles','Seychelles4_thumb.jpg',130, 195,18,'																			photo_4585123.html');
												thumbnails[4585475] = new thumbnail(4585475,'263275','Secluded Mooring - Falmouth, Cornwall, England','falmouthboat_thumb.jpg',130, 82,18,'																			photo_4585475.html');
												thumbnails[4605933] = new thumbnail(4605933,'263273','Charismatic Charm - Puffin, Skomer Island, South West Wales','puffin3_thumb.jpg',130, 195,18,'																			photo_4605933.html');
												thumbnails[4606078] = new thumbnail(4606078,'265598','Depleted - Fish Market, The Seychelles','deadfish_thumb.jpg',130, 194,18,'																			photo_4606078.html');
												thumbnails[4796041] = new thumbnail(4796041,'263276','St Pauls Cathedral & Lamp Post - London','spitalfields7_thumb.jpg',130, 194,18,'																			photo_4796041.html');
												thumbnails[6055269] = new thumbnail(6055269,'259374','My Perfect Sundown - Beau Vallon, The Seychelles','seychelles_sunset_beau_vallon_thumb.jpg',130, 195,18,'																			photo_6055269.html');
												thumbnails[4533081] = new thumbnail(4533081,'263273','Macaque monkey - Sepilok, Borneo','Monkey_1_thumb.jpg',130, 87,18,'																			photo_4533081.html');
												thumbnails[4585000] = new thumbnail(4585000,'263275','Ox-bow lake - Sukau, Borneo','In_the_jungle_ruff_11_thumb.jpg',130, 194,18,'																			photo_4585000.html');
												thumbnails[4605927] = new thumbnail(4605927,'265575','Wildflowers - Skomer Island, South West Wales','weeds0_thumb.jpg',130, 195,18,'																			photo_4605927.html');
												thumbnails[4449711] = new thumbnail(4449711,'259374','Manukan island pier - Kota Kinabalu, Borneo ','Manukan_island_2_thumb.jpg',130, 87,18,'																			photo_4449711.html');
												thumbnails[4605945] = new thumbnail(4605945,'263273','Puffin 2 - Skomer island, South West Wales','puffin1_thumb.jpg',130, 87,18,'																			photo_4605945.html');
												thumbnails[4585194] = new thumbnail(4585194,'263273','Hawker Dragonfly - Sepilok, Borneo','dragonfly_2_thumb.jpg',130, 87,18,'																			photo_4585194.html');
												thumbnails[4728871] = new thumbnail(4728871,'265598','On the steps of St Pauls Cathedral - London','wedding2_1_thumb.jpg',130, 87,18,'																			photo_4728871.html');
												thumbnails[4611679] = new thumbnail(4611679,'259374','Fallen Dusk - Celebes Sea, Borneo','pinksky2_thumb.jpg',130, 87,18,'																			photo_4611679.html');
												thumbnails[4782793] = new thumbnail(4782793,'263273','Mother and child - Sepilok, Borneo','Oran_Utang_and_baby_1_thumb.jpg',130, 87,18,'																			photo_4782793.html');
												thumbnails[4796045] = new thumbnail(4796045,'263275','Late Summer in the City - near St Pauls, London','spitalfields6_thumb.jpg',130, 87,18,'																			photo_4796045.html');
												thumbnails[5945755] = new thumbnail(5945755,'265575','Garden Daisies','flowers_thumb.JPG',130, 151,18,'																			photo_5945755.html');
												thumbnails[5978650] = new thumbnail(5978650,'259374','Sea Reflections - Si Amil Island, Borneo','borneo_sea_reflection_thumb.jpg',130, 87,18,'																			photo_5978650.html');
												thumbnails[4584944] = new thumbnail(4584944,'259374','Still Blue 2 - Celebes Sea, Borneo','Celebes_Sea_11_thumb.jpg',130, 194,18,'																			photo_4584944.html');
												thumbnails[4607626] = new thumbnail(4607626,'259373','Circular Spadefish - Hanging Garden reef, Sipadan, Borneo','Spadefish_2_thumb.jpg',130, 98,18,'																			photo_4607626.html');
												thumbnails[4607632] = new thumbnail(4607632,'259374','Island football - Beau Vallon, The Seychelles','footie_thumb.jpg',130, 177,18,'																			photo_4607632.html');
												thumbnails[4607627] = new thumbnail(4607627,'259373','Big Eyes & Scuba diver - Inner islands near La Digue, The Seychelles','3big_eye_bev_thumb.jpg',130, 173,18,'																			photo_4607627.html');
												thumbnails[4657775] = new thumbnail(4657775,'259373','Kelp Forest - Catalina Island, California','Kelp_reef_thumb.jpg',130, 173,18,'																			photo_4657775.html');
												thumbnails[6055258] = new thumbnail(6055258,'259374','Childhood Bliss - Beau Vallon, The Seychelles','beau_vallon_sunset_seychelles_thumb.jpg',130, 195,18,'																			photo_6055258.html');
												thumbnails[4611813] = new thumbnail(4611813,'259373','Resting Hawksbill - North Male Atoll, The Maldives','Hawksbill_turtle_2_thumb.jpg',130, 87,18,'																			photo_4611813.html');
												thumbnails[4770343] = new thumbnail(4770343,'259374','Still blue 3 - Celebes Sea, Sipadan','borneo5_1_thumb.jpg',130, 201,18,'																			photo_4770343.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[259373] = new gallery(259373,'6055091,6055089,6055088,5409083,4657775,4611813,4607627,4607626,4449580,4449577','Reefscapes','gallery',[4433928,4449381,4449387,4449388,4449390,4449391,4449542,4449561,4449569,4449574,4449577,4449580,5409083,6055088,6055089,6055091,4607626,4607627,4657775,4611813],0, 1, '', '																																																																																																							gallery_259373.html',0,0);
				  					galleries[259374] = new gallery(259374,'6055269,6055258,5978650,4770343,4611679,4607633,4607632,4585123,4584944,4584915','Seascapes','gallery',[4607633,4533540,4533618,4449701,4584905,4584915,4585123,6055269,4449711,4611679,5978650,4584944,4607632,6055258,4770343],0, 1, '', '																																																																																																							gallery_259374.html',0,0);
				  					galleries[263273] = new gallery(263273,'7245209,6055142,5960039,5409022,4782793,4605945,4605933,4585194,4585119,4533172','Wildlife','gallery',[5409022,6055142,7245209,4585119,4533172,5960039,4533122,4533072,4605933,4533081,4605945,4585194,4782793],0, 1, '', '																																																																																																							gallery_263273.html',0,0);
				  					galleries[263275] = new gallery(263275,'7245218,6995886,6995883,4796045,4729197,4611582,4605924,4585475,4585350,4585000','Landscapes','gallery',[4611582,4729197,6995883,6995886,7245218,4605924,4585350,4533258,4449705,4585475,4585000,4796045],0, 1, '', '																																																																																																							gallery_263275.html',0,0);
				  					galleries[263276] = new gallery(263276,'4796048,4796041,4613218,4611627,4605920,4533281,4533268','Architecture & Landmarks','gallery',[4533268,4533281,4605920,4611627,4796048,4613218,4796041],0, 1, '', '																																																																																																							gallery_263276.html',0,0);
				  					galleries[265575] = new gallery(265575,'6995879,5959265,5945755,4607628,4605927,4585433,4585431,4585249,4585181,4585179','Flowers','gallery',[4585431,4585433,4607628,5959265,6995879,4585179,4585181,4585176,4585249,4584924,4605927,5945755],0, 1, '', '																																																																																																							gallery_265575.html',0,0);
				  					galleries[265598] = new gallery(265598,'4985470,4985450,4770339,4728871,4657794,4606078,4606007,4585479,4585217','Reportage','gallery',[4585217,4985450,4585479,4606007,4657794,4770339,4985470,4606078,4728871],0, 1, '', '																																																																																																							gallery_265598.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '6583320,6461709';
imageSets[3] = '7245218,7245209,6995886,6995883,6995879,6583320,6461709,6152382,6055269,6055258,6055142,6055091,6055089,6055088,6044241,5978650,5968602,5960039,5959265,5945755,5409083,5409022,4985470,4985450,4797142,4797140,4796048,4796045,4796041,4783132,4782793,4770343,4770339,4731930,4729197,4728871,4657794,4657775,4613218,4611813,4611679,4611627,4611582,4607633,4607632,4607628,4607627,4607626,4606078,4606007';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/photoescape/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/photoescape/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/photoescape/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/photoescape/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/photoescape/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/photoescape/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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Photo Escape: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 							' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = 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 = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

		

