window.thumbnails = {};
															thumbnails[536941] = clik.newPhoto({"id":536941,"src":"4Dogfalls_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_536941.html","width":130,"caption":"Dog Falls","height":173});
															thumbnails[536965] = clik.newPhoto({"id":536965,"src":"18Boatshed_thumb.jpg","galleries_id":41599,"server_id":1,"link":"photo_536965.html","width":130,"caption":"Boat Shed","height":98});
															thumbnails[537000] = clik.newPhoto({"id":537000,"src":"44Drove_thumb.jpg","galleries_id":193138,"server_id":1,"link":"photo_537000.html","width":130,"caption":"Highland Drove Road","height":98});
															thumbnails[599572] = clik.newPhoto({"id":599572,"src":"River Coev3_thumb.jpg","galleries_id":193138,"server_id":1,"link":"photo_599572.html","width":130,"caption":"Snow on the Coe","height":98});
															thumbnails[599576] = clik.newPhoto({"id":599576,"src":"River Coupall_thumb.jpg","galleries_id":193138,"server_id":1,"link":"photo_599576.html","width":130,"caption":"Desolation","height":173});
															thumbnails[727917] = clik.newPhoto({"id":727917,"src":"Loch Eck 3v2_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_727917.html","width":130,"caption":"Reflections","height":98});
															thumbnails[741550] = clik.newPhoto({"id":741550,"src":"DSC038091_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_741550.html","width":130,"caption":"Winter Sunshine","height":98});
															thumbnails[741740] = clik.newPhoto({"id":741740,"src":"28 Commando Memorial_thumb.jpg","galleries_id":41599,"server_id":1,"link":"photo_741740.html","width":130,"caption":"Commando Memorial","height":98});
															thumbnails[843405] = clik.newPhoto({"id":843405,"src":"Waterfall Glen Etive_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_843405.html","width":130,"caption":"High Falls","height":173});
															thumbnails[956863] = clik.newPhoto({"id":956863,"src":"Ancient Tree, Loch Quoich_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956863.html","width":130,"caption":"Still Waters","height":98});
															thumbnails[956876] = clik.newPhoto({"id":956876,"src":"Birch Tree, Loch Garry_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956876.html","width":130,"caption":"Loch Garry","height":98});
															thumbnails[956881] = clik.newPhoto({"id":956881,"src":"Birch Tree, Loch Garry 2_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956881.html","width":130,"caption":"Portrait Loch Shore","height":173});
															thumbnails[956900] = clik.newPhoto({"id":956900,"src":"Burn by Loch Lochy 3_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956900.html","width":130,"caption":"Cascade","height":173});
															thumbnails[956906] = clik.newPhoto({"id":956906,"src":"Waterfall by Loch Ness_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956906.html","width":130,"caption":"Sunlit Fall","height":173});
															thumbnails[956922] = clik.newPhoto({"id":956922,"src":"Loch Tarff_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956922.html","width":130,"caption":"Golden Water","height":98});
															thumbnails[956936] = clik.newPhoto({"id":956936,"src":"Portrait Eilean Donan1_thumb.jpg","galleries_id":41599,"server_id":1,"link":"photo_956936.html","width":130,"caption":"Eilean Donan, North","height":173});
															thumbnails[956941] = clik.newPhoto({"id":956941,"src":"River Moriston_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956941.html","width":130,"caption":"Rainbow Water","height":173});
															thumbnails[956953] = clik.newPhoto({"id":956953,"src":"Rockpool at Hopeman 3_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956953.html","width":130,"caption":"Bootlace Seaweed","height":98});
															thumbnails[956963] = clik.newPhoto({"id":956963,"src":"The Princes Cairn, Loch Nan Uamh 2_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956963.html","width":130,"caption":"The Princes Cairn","height":173});
															thumbnails[956966] = clik.newPhoto({"id":956966,"src":"The Witches Cauldron_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_956966.html","width":130,"caption":"The Witches Cauldron","height":173});
															thumbnails[998597] = clik.newPhoto({"id":998597,"src":"Pebbles at Findhorn 2_thumb.jpg","galleries_id":41148,"server_id":1,"link":"photo_998597.html","width":130,"caption":"Timber and Pebbles","height":173});
															thumbnails[1547737] = clik.newPhoto({"id":1547737,"src":"Sunset Silhouette_thumb.jpg","galleries_id":41601,"server_id":1,"link":"photo_1547737.html","width":130,"caption":"Sunset Silhouette","height":199});
															thumbnails[1547750] = clik.newPhoto({"id":1547750,"src":"Glenfinnan Monument_thumb.jpg","galleries_id":41599,"server_id":1,"link":"photo_1547750.html","width":130,"caption":"Glenfinnan Monument","height":85});
															thumbnails[1547762] = clik.newPhoto({"id":1547762,"src":"Pebbles 'n Sand_thumb.jpg","galleries_id":41148,"server_id":1,"link":"photo_1547762.html","width":130,"caption":"Pebbles 'n Sand","height":96});
															thumbnails[1547763] = clik.newPhoto({"id":1547763,"src":"Autumn Colours_thumb.jpg","galleries_id":374293,"server_id":1,"link":"photo_1547763.html","width":130,"caption":"Autumn Colours","height":194});
															thumbnails[1547765] = clik.newPhoto({"id":1547765,"src":"Mountain Stream_thumb.jpg","galleries_id":41148,"server_id":1,"link":"photo_1547765.html","width":130,"caption":"Hanging on","height":98});
															thumbnails[1547767] = clik.newPhoto({"id":1547767,"src":"Inchnacardoch Bay_thumb.jpg","galleries_id":130489,"server_id":1,"link":"photo_1547767.html","width":130,"caption":"Boats on Ness","height":98});
															thumbnails[2393325] = clik.newPhoto({"id":2393325,"src":"Distant Ribbons RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_2393325.html","width":130,"caption":"Distant Ribbons","height":173});
															thumbnails[2393328] = clik.newPhoto({"id":2393328,"src":"Milky Falls RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_2393328.html","width":130,"caption":"Milky Falls","height":98});
															thumbnails[3249576] = clik.newPhoto({"id":3249576,"src":"Milky Rocks RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_3249576.html","width":130,"caption":"Milky Rocks","height":98});
															thumbnails[3249579] = clik.newPhoto({"id":3249579,"src":"Sand Patterns RS_thumb.jpg","galleries_id":41148,"server_id":1,"link":"photo_3249579.html","width":130,"caption":"Sand Patterns","height":173});
															thumbnails[3249592] = clik.newPhoto({"id":3249592,"src":"Misty burn P RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_3249592.html","width":130,"caption":"Misty Burn Portrait","height":173});
															thumbnails[3249597] = clik.newPhoto({"id":3249597,"src":"Evening tumble RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_3249597.html","width":130,"caption":"Evening Tumble","height":173});
															thumbnails[3354903] = clik.newPhoto({"id":3354903,"src":"Etive Winter RS_thumb.jpg","galleries_id":41148,"server_id":1,"link":"photo_3354903.html","width":130,"caption":"Etive Winter","height":104});
															thumbnails[3950297] = clik.newPhoto({"id":3950297,"src":"MV_Jupiter_arriving_at_Dunoon_Pier_rs_thumb.jpg","galleries_id":130489,"server_id":1,"link":"photo_3950297.html","width":130,"caption":"mv Jupiter arriving at Dunoon Pier","height":98});
															thumbnails[4295120] = clik.newPhoto({"id":4295120,"src":"P1050296v3_rs_thumb.jpg","galleries_id":130489,"server_id":1,"link":"photo_4295120.html","width":130,"caption":"Resting on Loch Striven, Argyll","height":98});
															thumbnails[6003606] = clik.newPhoto({"id":6003606,"src":"Autumn_in_Affric_-_RS_thumb.jpg","galleries_id":374293,"server_id":1,"link":"photo_6003606.html","width":130,"caption":"Autumn in Affric","height":98});
															thumbnails[6003613] = clik.newPhoto({"id":6003613,"src":"Float_On_-_RS_thumb.jpg","galleries_id":130489,"server_id":1,"link":"photo_6003613.html","width":130,"caption":"Float On","height":173});
															thumbnails[6091279] = clik.newPhoto({"id":6091279,"src":"5_Loch_Fyne_Sunset_RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_6091279.html","width":130,"caption":"Loch Fyne Sunset","height":98});
															thumbnails[6091301] = clik.newPhoto({"id":6091301,"src":"1_Ardentinny_Bluebells_RS_thumb.jpg","galleries_id":41601,"server_id":1,"link":"photo_6091301.html","width":130,"caption":"Ardentinny Bluebells","height":173});
															thumbnails[6184287] = clik.newPhoto({"id":6184287,"src":"Frozen_Lock_Eck_Trees_RS_thumb.jpg","galleries_id":193138,"server_id":1,"link":"photo_6184287.html","width":130,"caption":"Frozen Loch Eck","height":98});
															thumbnails[6636375] = clik.newPhoto({"id":6636375,"src":"Gannet_in_Flight_RS_thumb.jpg","galleries_id":41601,"server_id":1,"link":"photo_6636375.html","width":130,"caption":"Gannet in Flight","height":98});
															thumbnails[6636394] = clik.newPhoto({"id":6636394,"src":"Yachts_at_Otterferry_RS_thumb.jpg","galleries_id":130489,"server_id":1,"link":"photo_6636394.html","width":130,"caption":"Yachts at Otterferry","height":98});
															thumbnails[6896936] = clik.newPhoto({"id":6896936,"src":"P1070676v2_2RS_thumb.jpg","galleries_id":41599,"server_id":1,"link":"photo_6896936.html","width":130,"caption":"Chapel","height":98});
															thumbnails[6896939] = clik.newPhoto({"id":6896939,"src":"P1070697v2RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_6896939.html","width":130,"caption":"Caledonian Canal by Loch Lochy","height":98});
															thumbnails[6896962] = clik.newPhoto({"id":6896962,"src":"P1070710v2RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_6896962.html","width":130,"caption":"Moody Sky over Loch Garry","height":98});
															thumbnails[6896963] = clik.newPhoto({"id":6896963,"src":"P1070724v2RS_thumb.jpg","galleries_id":41601,"server_id":1,"link":"photo_6896963.html","width":130,"caption":"Monaliths","height":98});
															thumbnails[6896970] = clik.newPhoto({"id":6896970,"src":"P1070735v2RS_thumb.jpg","galleries_id":41601,"server_id":1,"link":"photo_6896970.html","width":130,"caption":"Reach for the sky","height":173});
															thumbnails[6902501] = clik.newPhoto({"id":6902501,"src":"Jack_the_Jack_RS_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_6902501.html","width":130,"caption":"Jack the Jack","height":98});
															thumbnails[6902503] = clik.newPhoto({"id":6902503,"src":"TobyRS_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_6902503.html","width":130,"caption":"Toby","height":98});
															thumbnails[6911282] = clik.newPhoto({"id":6911282,"src":"Portrait_SunnyRS_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_6911282.html","width":130,"caption":"Sunny","height":194});
															thumbnails[6947332] = clik.newPhoto({"id":6947332,"src":"Loch_Caolisport_shoreline_RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_6947332.html","width":130,"caption":"Loch Caolisport shoreline, Argyll","height":173});
															thumbnails[6947340] = clik.newPhoto({"id":6947340,"src":"Sunset_over_Loch_Caolisport_RS_thumb.jpg","galleries_id":41017,"server_id":1,"link":"photo_6947340.html","width":130,"caption":"Sunset over Loch Caolisport","height":98});
															thumbnails[6947485] = clik.newPhoto({"id":6947485,"src":"Luss_on_Loch_Lomond_RS_thumb.jpg","galleries_id":130489,"server_id":1,"link":"photo_6947485.html","width":130,"caption":"Luss on Loch Lomond","height":98});
															thumbnails[7168692] = clik.newPhoto({"id":7168692,"src":"Gordon_Setters_RS12_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168692.html","width":130,"caption":"Gordon Setters","height":99});
															thumbnails[7168696] = clik.newPhoto({"id":7168696,"src":"Taz_2_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168696.html","width":130,"caption":"Taz 2","height":98});
															thumbnails[7168698] = clik.newPhoto({"id":7168698,"src":"Blu_in_FlightRS12_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168698.html","width":130,"caption":"Blu in flight","height":173});
															thumbnails[7168743] = clik.newPhoto({"id":7168743,"src":"Bria_2RS123_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168743.html","width":130,"caption":"Bria 2","height":132});
															thumbnails[7168787] = clik.newPhoto({"id":7168787,"src":"Bria_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168787.html","width":130,"caption":"Bria","height":98});
															thumbnails[7168804] = clik.newPhoto({"id":7168804,"src":"Calla_RS12_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168804.html","width":130,"caption":"Calla","height":120});
															thumbnails[7168807] = clik.newPhoto({"id":7168807,"src":"German_Shepherd_2RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168807.html","width":130,"caption":"German Shepherd 2","height":173});
															thumbnails[7168809] = clik.newPhoto({"id":7168809,"src":"German_Shepherd_RS123_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168809.html","width":130,"caption":"German Shepherd","height":152});
															thumbnails[7168812] = clik.newPhoto({"id":7168812,"src":"Harvey_2_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168812.html","width":130,"caption":"Harvey 2","height":173});
															thumbnails[7168814] = clik.newPhoto({"id":7168814,"src":"Harvey_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168814.html","width":130,"caption":"Harvey","height":98});
															thumbnails[7168818] = clik.newPhoto({"id":7168818,"src":"Lolly_2RS12_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168818.html","width":130,"caption":"Lolly 2","height":173});
															thumbnails[7168822] = clik.newPhoto({"id":7168822,"src":"Lolly_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168822.html","width":130,"caption":"Lolly","height":88});
															thumbnails[7168823] = clik.newPhoto({"id":7168823,"src":"Midge_and_Harvey_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168823.html","width":130,"caption":"Midge and Harvey","height":98});
															thumbnails[7168825] = clik.newPhoto({"id":7168825,"src":"Murphy_2RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168825.html","width":130,"caption":"Murphy 2","height":173});
															thumbnails[7168827] = clik.newPhoto({"id":7168827,"src":"MurphyRS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168827.html","width":130,"caption":"Murphy","height":103});
															thumbnails[7168830] = clik.newPhoto({"id":7168830,"src":"Psycho_Staffie_2RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168830.html","width":130,"caption":"Staffie 2","height":96});
															thumbnails[7168833] = clik.newPhoto({"id":7168833,"src":"Psycho_Staffie_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168833.html","width":130,"caption":"Staffie","height":169});
															thumbnails[7168836] = clik.newPhoto({"id":7168836,"src":"Scamp_and_Snoopy_2_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168836.html","width":130,"caption":"Scamp and Snoopy 2","height":98});
															thumbnails[7168838] = clik.newPhoto({"id":7168838,"src":"Scamp_and_Snoopy_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168838.html","width":130,"caption":"Scamp and Snoopy","height":104});
															thumbnails[7168841] = clik.newPhoto({"id":7168841,"src":"Skye_2RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168841.html","width":130,"caption":"Skye 2","height":138});
															thumbnails[7168845] = clik.newPhoto({"id":7168845,"src":"SkyeRS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168845.html","width":130,"caption":"Skye","height":104});
															thumbnails[7168847] = clik.newPhoto({"id":7168847,"src":"Spice_2RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168847.html","width":130,"caption":"Spice 2","height":148});
															thumbnails[7168861] = clik.newPhoto({"id":7168861,"src":"SpiceRS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168861.html","width":130,"caption":"Spice","height":98});
															thumbnails[7168873] = clik.newPhoto({"id":7168873,"src":"Sunny_and_Blu_RS1_thumb.jpg","galleries_id":374289,"server_id":1,"link":"photo_7168873.html","width":130,"caption":"Sunny and Blue","height":105});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[41017] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lochs, Rivers and Waterfalls","link":"gallery_41017.html","maxRecords":0.0,"photoIDs":[536941.0,727917.0,741550.0,843405.0,956863.0,956876.0,956881.0,956900.0,956906.0,956922.0,956941.0,956953.0,956963.0,956966.0,2393325.0,2393328.0,3249576.0,3249592.0,3249597.0,6091279.0,6896939.0,6896962.0,6947332.0,6947340.0],"skipIndex":0,"section_code":"gallery","featured_images":"6947340,6947332,6896962,6896939,6091279,3249597,3249592,3249576,2393328,2393325","id":41017,"singleSection":false});				  						galleries[41601] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Miscellaneous","link":"gallery_41601.html","maxRecords":0.0,"photoIDs":[1547737.0,6091301.0,6636375.0,6896963.0,6896970.0],"skipIndex":0,"section_code":"gallery","featured_images":"6896970,6896963,6636375,6091301,1547737","id":41601,"singleSection":false});				  						galleries[41148] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Abstract Images","link":"gallery_41148.html","maxRecords":0.0,"photoIDs":[998597.0,1547762.0,1547765.0,3249579.0,3354903.0],"skipIndex":0,"section_code":"gallery","featured_images":"3354903,3249579,1547765,1547762,998597","id":41148,"singleSection":false});				  						galleries[130489] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Boats and Ships","link":"gallery_130489.html","maxRecords":0.0,"photoIDs":[1547767.0,3950297.0,4295120.0,6003613.0,6636394.0,6947485.0],"skipIndex":0,"section_code":"gallery","featured_images":"6947485,6636394,6003613,4295120,3950297,1547767","id":130489,"singleSection":false});				  						galleries[193138] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Winter Scenes","link":"gallery_193138.html","maxRecords":0.0,"photoIDs":[537000.0,599572.0,599576.0,6184287.0],"skipIndex":0,"section_code":"gallery","featured_images":"6184287,599576,599572,537000","id":193138,"singleSection":false});				  						galleries[41599] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Buildings and Structures","link":"gallery_41599.html","maxRecords":0.0,"photoIDs":[536965.0,741740.0,956936.0,1547750.0,6896936.0],"skipIndex":0,"section_code":"gallery","featured_images":"6896936,1547750,956936,741740,536965","id":41599,"singleSection":false});				  						galleries[374289] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Pets","link":"gallery_374289.html","maxRecords":0.0,"photoIDs":[6902501.0,6902503.0,6911282.0,7168692.0,7168696.0,7168698.0,7168743.0,7168787.0,7168804.0,7168807.0,7168809.0,7168812.0,7168814.0,7168818.0,7168822.0,7168823.0,7168825.0,7168827.0,7168830.0,7168833.0,7168836.0,7168838.0,7168841.0,7168845.0,7168847.0,7168861.0,7168873.0],"skipIndex":0,"section_code":"gallery","featured_images":"7168873,7168861,7168847,7168845,7168841,7168838,7168836,7168833,7168830,7168827","id":374289,"singleSection":false});				  						galleries[374293] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Autumn Scenes","link":"gallery_374293.html","maxRecords":0.0,"photoIDs":[1547763.0,6003606.0],"skipIndex":0,"section_code":"gallery","featured_images":"6003606,1547763","id":374293,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6947332,6896970,6896963,6896962,6896936,956881,956863,741740,599576';
imageSets[3] = '7168873,7168861,7168847,7168845,7168841,7168838,7168836,7168833,7168830,7168827,7168825,7168823,7168822,7168818,7168814,7168812,7168809,7168807,7168804,7168787,7168743,7168698,7168696,7168692,6947485,6947340,6947332,6911282,6902503,6902501,6896970,6896963,6896962,6896939,6896936,6636394,6636375,6184287,6091301,6091279,6003613,6003606,4295120,3950297,3354903,3249597,3249592,3249579,3249576,2393328';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/jerryhill/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/jerryhill/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 = 'Jerry Hill 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="jerry.hill05@btinternet.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="jerry.hill05@btinternet.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;
	}
}

			

