window.thumbnails = {};
															thumbnails[298128] = clik.newPhoto({"id":298128,"src":"DP_810--Llyn-Ogwen-Waterfall-North-Wales_6A7BDD72-1EC9-DFB6-090F03F300339144_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_298128.html","width":160,"caption":"Llyn Ogwen Waterfall, North Wales","height":106});
															thumbnails[298183] = clik.newPhoto({"id":298183,"src":"DP-2808-Bluebell-Dawn_6A8CB6F6-1EC9-DFB6-09FAFB2F8B603F3A_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_298183.html","width":160,"caption":"Bluebell Dawn, Micheldever Wood, Hampshire ","height":59});
															thumbnails[298229] = clik.newPhoto({"id":298229,"src":"-DP3487-Steyning-Bowl-valley-in-morning-mist-_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_298229.html","width":160,"caption":"Morning mist, Steyning Bowl valley, West Sussex. ","height":59});
															thumbnails[298238] = clik.newPhoto({"id":298238,"src":"DP3969-The-Dolomites-Italy_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_298238.html","width":160,"caption":"On top of the world - The Dolomites, Siss Pardoi, Tyrol, Italy","height":59});
															thumbnails[298251] = clik.newPhoto({"id":298251,"src":"DP3984_Malcesine--Dawn-Lake-Garda-Italy-_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_298251.html","width":160,"caption":"Malcesine at Sunrise, Lake Garda, Italy","height":59});
															thumbnails[298266] = clik.newPhoto({"id":298266,"src":"DP4266-Autumn_Reflection_Winkworth_Surrey_6B0EBE77-1EC9-DFB6-09F1D5159A94E1F6_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_298266.html","width":160,"caption":"Autumn Reflection, Winkworth, Arboretum, Surrey","height":59});
															thumbnails[298326] = clik.newPhoto({"id":298326,"src":"DP4490-The_Mornnig_Sun_on_Chactonbury_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_298326.html","width":105,"caption":"The Morning Sun on Chanctonbury Ring, West Sussex ","height":160});
															thumbnails[298333] = clik.newPhoto({"id":298333,"src":"DP-61-Coldwaltham-Bluebells_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_298333.html","width":160,"caption":"Bluebells of Coldwaltham, Coldwaltham park, West Sussex.","height":109});
															thumbnails[298360] = clik.newPhoto({"id":298360,"src":"DP3393-February_Dawn_69832225-24E8-5EC4-4F619B60DE9110B6_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_298360.html","width":160,"caption":"February Dawn. Worthing Coastline, West Sussex.","height":59});
															thumbnails[298414] = clik.newPhoto({"id":298414,"src":"DP4293_Dawn_reflection_98598FB0-24E8-5EC4-4F6EFB60E14D694B_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_298414.html","width":160,"caption":"Dawn reflection. West Wittering, West Sussex","height":106});
															thumbnails[298485] = clik.newPhoto({"id":298485,"src":"DP4297_Tranquil_Refletion_West_Wittering_98808DD8-24E8-5EC4-4F20848857C96D12_thumb_9886F7B0-24E8-5EC4-4FCBD446B1CBE036.jpg","galleries_id":25976,"server_id":15,"link":"photo_298485.html","width":160,"caption":"Tranquil Reflection, West Wittering, West Sussex","height":106});
															thumbnails[298497] = clik.newPhoto({"id":298497,"src":"DP4311_Seven_Sisters_Refection_989F6C06-24E8-5EC4-4FD662A07AEE9628_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_298497.html","width":160,"caption":"Cuckmere Haven & Seven Sisters, East Sussex","height":114});
															thumbnails[298657] = clik.newPhoto({"id":298657,"src":"DP4374-The_incoming_tide_99D30E0C-24E8-5EC4-4FEB1218AB8A0E6A_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_298657.html","width":160,"caption":"The incoming tide 2. Worthing, West sussex.","height":106});
															thumbnails[298662] = clik.newPhoto({"id":298662,"src":"DP-2377_Poin_of_Ayr_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_298662.html","width":160,"caption":"Point of Ayr,Dee Estuary, North Wales","height":59});
															thumbnails[298664] = clik.newPhoto({"id":298664,"src":"DP 4301-Path_to_cottages_Cuckmere_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_298664.html","width":106,"caption":"Path to the cottages, Cuckmere Haven, East Sussex","height":160});
															thumbnails[298674] = clik.newPhoto({"id":298674,"src":"DP1524A-Morning-Glow_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_298674.html","width":160,"caption":"Morning Glow, Sussex Poppy field, Truleigh hill, West sussex","height":83});
															thumbnails[299057] = clik.newPhoto({"id":299057,"src":"DP4222_ Autumn_dew_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_299057.html","width":130,"caption":"Autumn leaves. Winkworth Arboretum, Surrey. ","height":105});
															thumbnails[299058] = clik.newPhoto({"id":299058,"src":"DP4225_Autumn_dew001_A0D69A6B-1EC9-DFB6-0989F90AB2922C0B_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_299058.html","width":160,"caption":"Autumn dew, Winkworth Arboretum, Surrey  ","height":104});
															thumbnails[299062] = clik.newPhoto({"id":299062,"src":"DP4237-Autumn_Shades_A0F83A98-1EC9-DFB6-09D0F58B54FA0E7F_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_299062.html","width":160,"caption":"Shades of Autumn, Winkworth Arboretum, Surrey ","height":106});
															thumbnails[299065] = clik.newPhoto({"id":299065,"src":"DP-4228-A--Acer-in-Autumn-colour_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_299065.html","width":106,"caption":"Acer in Autumn colour, Winkworth Arboretum, Surrey ","height":160});
															thumbnails[299119] = clik.newPhoto({"id":299119,"src":"DP-4230---Acer-in-Autumn-colour_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_299119.html","width":160,"caption":"Autumn Splendour, Winkworth Arboretum, Surrey ","height":106});
															thumbnails[299169] = clik.newPhoto({"id":299169,"src":"DP3140_Dalmatia_Sunset.Island_of_Brac_Adriatic_Sea_Croatia_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_299169.html","width":160,"caption":"Dalmatia Sunset.Island of Brac, Adriatic Sea, Croatia.","height":59});
															thumbnails[299319] = clik.newPhoto({"id":299319,"src":"DP3787-Arundel_at_sunset_West_Sussex_D521DADA-1EC9-DFB6-09789BD27E0D562C_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_299319.html","width":160,"caption":"Arundel at sunset. River Arun, Arundel, West Sussex.  ","height":83});
															thumbnails[299363] = clik.newPhoto({"id":299363,"src":"DP4345_Days_End_Goring_beach_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_299363.html","width":160,"caption":"Days End, Goring beach,West Sussex . ","height":106});
															thumbnails[299369] = clik.newPhoto({"id":299369,"src":"DP4349_Setting_Sun_Goring_beach_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_299369.html","width":160,"caption":"Setting Sun,Goring beach West Sussex. ","height":106});
															thumbnails[299373] = clik.newPhoto({"id":299373,"src":"DP4429-Harbour_Pier_at_sunrise_Littlehampton_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_299373.html","width":160,"caption":"Harbour Pier at sunrise 2. Littlehampton,West Sussex. ","height":106});
															thumbnails[299375] = clik.newPhoto({"id":299375,"src":"DP4432_Harbour_Pierat_sunrise_Littlehampton_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_299375.html","width":160,"caption":"Harbour Pier at sunrise. Littlehampton,West Sussex. ","height":107});
															thumbnails[299439] = clik.newPhoto({"id":299439,"src":"DP4495_Chanctonbury_Sunrise_D59F9A1C-1EC9-DFB6-0969B3A6C4B7F45B_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_299439.html","width":160,"caption":"Chanctonbury Sunrise. Chanctonbury, West Sussex.","height":106});
															thumbnails[299480] = clik.newPhoto({"id":299480,"src":"DP4495_Chanctonbury_Dawn_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_299480.html","width":160,"caption":"Sunrise on top of Chanctobury, West Sussex.","height":106});
															thumbnails[808368] = clik.newPhoto({"id":808368,"src":"DP3531-Worthing-Pier-at-Sunriset_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_808368.html","width":160,"caption":"Worthing Pier at sunrise. Worthing, West Sussex","height":59});
															thumbnails[808420] = clik.newPhoto({"id":808420,"src":"DP-2098-Tranquil-sunriseWorthing-Pier_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_808420.html","width":160,"caption":"Tranquil Sunrise.Worthing Pier, Worthing, West Sussex","height":110});
															thumbnails[808534] = clik.newPhoto({"id":808534,"src":"DP 3839 Worthing Pier, Worthing, West Sussex_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_808534.html","width":160,"caption":"Worthing Pier and seashore, Worthing, West Sussex   ","height":106});
															thumbnails[808915] = clik.newPhoto({"id":808915,"src":"DP 4687 Marloes stones_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_808915.html","width":160,"caption":"Marloes Stones, Marloes Sands, Pembrokeshire, South Wales","height":106});
															thumbnails[810505] = clik.newPhoto({"id":810505,"src":"DP 4946 Coastal chalk formation, Birling Gap, E.Sussex_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_810505.html","width":106,"caption":"Coastal chalk formation and cliffs, Birling Gap, East Sussex","height":160});
															thumbnails[810515] = clik.newPhoto({"id":810515,"src":"DP 4995 Stormy seas at Lancing, West Sussex_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_810515.html","width":120,"caption":"Stormy seas. Lancing, Near Worthing, West Sussex","height":160});
															thumbnails[6593271] = clik.newPhoto({"id":6593271,"src":"DP-4982-Stormy-Sunrise-Lancing-Coast_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_6593271.html","width":160,"caption":"Stormy Sunrise, Lancing Coast, West Sussex","height":106});
															thumbnails[6594201] = clik.newPhoto({"id":6594201,"src":"-DP-MG-2515-Cymbidium-Orchid-Min-Cym-Sue-blush_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_6594201.html","width":112,"caption":"Cymbidium Orchid, 'Min-Cym-Sue'. ","height":160});
															thumbnails[6594276] = clik.newPhoto({"id":6594276,"src":"_DP_MG_2621-Flowing-waters-of-river-Ashop-_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_6594276.html","width":160,"caption":"Flowing Water of the River Ashop.","height":106});
															thumbnails[6594378] = clik.newPhoto({"id":6594378,"src":"_DP_MG_3008-Incoming-tide-3-Worthing-West-Sussex-1_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_6594378.html","width":160,"caption":"Incoming-tide-3. ","height":107});
															thumbnails[6605354] = clik.newPhoto({"id":6605354,"src":"_DP_MG_3822-Receeding-tide-_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_6605354.html","width":160,"caption":"Receding tide","height":106});
															thumbnails[6605559] = clik.newPhoto({"id":6605559,"src":"DP_MG_5163-Sunset-Reflection-Longfurlong_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_6605559.html","width":160,"caption":"Summer Bales - Longfurlong. ","height":116});
															thumbnails[6605699] = clik.newPhoto({"id":6605699,"src":"DP_MG_0348-Sunset-Goring-beach-Worthing-West-Sussex_D63642E2-1EC9-D45B-1C1A7E80BAE8FD76_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_6605699.html","width":160,"caption":"Sea lane sunset, Goring beach","height":107});
															thumbnails[6610373] = clik.newPhoto({"id":6610373,"src":"DP6500_MG_2059-Daw--top-of-Goodwood-West-Sussex--pan_7351BA3E-1EC9-D45B-1C637B255DE3A6B5_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_6610373.html","width":160,"caption":"Dawn at Goodwood","height":83});
															thumbnails[6611834] = clik.newPhoto({"id":6611834,"src":"DP-4676-Marloes-Stones-2-Marloes-Pembrokeshire_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_6611834.html","width":160,"caption":"Marloes Stones 2","height":106});
															thumbnails[6612022] = clik.newPhoto({"id":6612022,"src":"DP_MG_4696-Aquilegia-Highdown-Gardens-West-Sussex-print_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_6612022.html","width":160,"caption":"Aquilegia ","height":116});
															thumbnails[6613008] = clik.newPhoto({"id":6613008,"src":"DP-5498-Glencoe-Lochan_73962135-1EC9-D45B-1CBB1DF36C083017_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_6613008.html","width":160,"caption":"Glencoe Lochan","height":106});
															thumbnails[7813834] = clik.newPhoto({"id":7813834,"src":"-DP_MG_2740-Lone-Tree-Broadhead-Clough-Dark-Peak-Peak-District-1_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_7813834.html","width":107,"caption":"Lone Tree","height":160});
															thumbnails[7817474] = clik.newPhoto({"id":7817474,"src":"-DP_MG_6365-Worthimg-Pier-at-Dusk_9B123EEB-1EC9-D45B-1C62397A7A32D9EB_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_7817474.html","width":110,"caption":"Worthing Pier at Dusk, Worthing, West Sussex.","height":160});
															thumbnails[7818187] = clik.newPhoto({"id":7818187,"src":"DP_MG_1803-Dry-stoned-walled-field-near-Castletown-The-Peak-District-Derbyshire12._thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_7818187.html","width":160,"caption":" Dry stoned walled fields ","height":107});
															thumbnails[7818369] = clik.newPhoto({"id":7818369,"src":"DP5563-Waterfalls-on-river-Nevis-Scotland_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_7818369.html","width":160,"caption":"Waterfalls on river Nevis","height":108});
															thumbnails[7819377] = clik.newPhoto({"id":7819377,"src":"DP_MG_2271-View-of-Amberley-from-Bury-Hill-West-Sussex_73B30106-1EC9-D45B-1CEB99C547B69EA8_thumb.jpg","galleries_id":25960,"server_id":15,"link":"photo_7819377.html","width":160,"caption":"A view from Bury Hill","height":110});
															thumbnails[8901071] = clik.newPhoto({"id":8901071,"src":"DP-4336-View--from-Seaford-Head-Seaford-Head-East-Sussex-_D651CB12-1EC9-D45B-1C646E6FD7774CBD_thumb.jpg","galleries_id":26002,"server_id":15,"link":"photo_8901071.html","width":160,"caption":"A view from Seaford Head ","height":59});
															thumbnails[8909447] = clik.newPhoto({"id":8909447,"src":"DP_MG_4518-Close-up-of-English-Bluebell-Coldwaltham-Park-West-Sussex_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_8909447.html","width":160,"caption":"Close-up image of English Bluebell, Coldwaltham Park,West Sussex","height":107});
															thumbnails[8923817] = clik.newPhoto({"id":8923817,"src":"DP-5212-Japanese-White-Anemone-Ranunculaceae_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_8923817.html","width":160,"caption":"Image of Japanese White Anemone (Ranunculaceae)","height":112});
															thumbnails[299045] = clik.newPhoto({"id":299045,"src":"DP3002_-Dahlia_Autumn_-Fire_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_299045.html","width":160,"caption":"Dahlia (Autumn-Fire), Worthing, West Sussex","height":105});
															thumbnails[9051075] = clik.newPhoto({"id":9051075,"src":"DP4339_Seaford_Head_reflection1_thumb.jpg","galleries_id":25976,"server_id":15,"link":"photo_9051075.html","width":160,"caption":"Seaford Head reflection","height":106});
															thumbnails[299048] = clik.newPhoto({"id":299048,"src":"DP3475_Tulips_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_299048.html","width":160,"caption":"Tulips. Home, Studio, Worthing, West Sussex ","height":107});
															thumbnails[808457] = clik.newPhoto({"id":808457,"src":"DP-3690-Yellow-Rhododendron-Luteum-Leonardslee-Gardens-West-Sussex_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_808457.html","width":160,"caption":"Yellow Rhododendron, Luteum, Leonardslee Gardens, West Sussex","height":110});
															thumbnails[299054] = clik.newPhoto({"id":299054,"src":"DP-3610-Bluebell-cascade_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_299054.html","width":160,"caption":"Bluebell Cascade, Arlington Bluebells, Arlington, East Sussex ","height":106});
															thumbnails[808445] = clik.newPhoto({"id":808445,"src":"DP-3547-Red-Tulips--Liliaceae--Regents-Park-Gardens-London_CDFFC207-1E4F-37DC-71C8DD6415FF5DA6_thumb.jpg","galleries_id":25992,"server_id":15,"link":"photo_808445.html","width":160,"caption":"Red Tulips ( Liliaceae ) and wallflowers, Regents Park Gardens, London  ","height":108});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[25992] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Flora and Fauna","link":"gallery_25992.html","maxRecords":0.0,"photoIDs":[298674.0,299057.0,299058.0,299062.0,299065.0,299119.0,6594201.0,6612022.0,8909447.0,8923817.0,299045.0,299048.0,808457.0,299054.0,808445.0],"skipIndex":0,"section_code":"gallery","featured_images":"8923817,8909447,6612022,299054,298674","id":25992,"singleSection":false});				  						galleries[25960] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_25960.html","maxRecords":0.0,"photoIDs":[298128.0,298183.0,298229.0,298238.0,298251.0,298266.0,298326.0,298333.0,6594276.0,6605559.0,6610373.0,6613008.0,7813834.0,7818187.0,7818369.0,7819377.0],"skipIndex":0,"section_code":"gallery","featured_images":"6610373,298183,298128","id":25960,"singleSection":false});				  						galleries[25976] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Seascapes","link":"gallery_25976.html","maxRecords":0.0,"photoIDs":[298360.0,298414.0,298485.0,298497.0,298657.0,298662.0,298664.0,808534.0,808915.0,810505.0,810515.0,6594378.0,6605354.0,6611834.0,7817474.0,9051075.0],"skipIndex":0,"section_code":"gallery","featured_images":"6594378,298360","id":25976,"singleSection":false});				  						galleries[26002] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sunsets and Sunrises","link":"gallery_26002.html","maxRecords":0.0,"photoIDs":[299169.0,299319.0,299363.0,299369.0,299373.0,299375.0,299439.0,299480.0,808368.0,808420.0,6593271.0,6605699.0,8901071.0],"skipIndex":0,"section_code":"gallery","featured_images":"8901071,6605699,6593271,808420,808368,299319,299169","id":26002,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8923817,8909447,8901071,7819377,7818369,7818187,7817474,7813834,6613008,6612022,6611834,6610373,6605699,6605559,6605354,6594378,6594276,6593271,810515,810505,808915,808534,808420,808368,299480,299375,299373,299369,299363,299319,299169,299119,299062,299058,299057,298674,298664,298662,298657,298497,298485,298414,298360,298333,298326,298266,298251,298238,298229,298183,298128,9051075,299045,299048,808457,299054,808445';
imageSets[2] = '8923817,8909447,8901071,6612022,6610373,6605699,6594378,6593271,808420,808368,299319,299169,298674,298360,298183,298128,299054';
imageSets[3] = '8901071';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/derekpayne/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/derekpayne/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = (backgrounds || photos || {})[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Derek Payne LANDSCAPE Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
	temp += this.fnGetPaymentInfo();
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp += '<p>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="derekpayne_photo2001@btopenworld.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="derekpayne_photo2001@btopenworld.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

