window.thumbnails = {};
															thumbnails[1141908] = clik.newPhoto({"id":1141908,"src":"home-page-cut_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":86});
															thumbnails[1141939] = clik.newPhoto({"id":1141939,"src":"easel1.jpg","galleries_id":"","server_id":18,"link":"#","width":100,"caption":"","height":75});
															thumbnails[5680422] = clik.newPhoto({"id":5680422,"src":"The-Young-Lady-in-Black_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_5680422.html","width":130,"caption":"Ellie - The Young Lady in Black<br>\r\n(oil)","height":178});
															thumbnails[5498057] = clik.newPhoto({"id":5498057,"src":"Vera_thumb.jpg","galleries_id":82973,"server_id":18,"link":"photo_5498057.html","width":120,"caption":"Vera (oil)","height":171});
															thumbnails[4607739] = clik.newPhoto({"id":4607739,"src":"A-Head-Rings-Out_thumb.jpg","galleries_id":219010,"server_id":18,"link":"photo_4607739.html","width":130,"caption":"A Head Rings Out (oil)","height":160});
															thumbnails[4607740] = clik.newPhoto({"id":4607740,"src":"Concourse_thumb.jpg","galleries_id":148105,"server_id":18,"link":"photo_4607740.html","width":130,"caption":"Concourse (oil)","height":111});
															thumbnails[4364473] = clik.newPhoto({"id":4364473,"src":"Sheila-Loughlin_thumb.jpg","galleries_id":148105,"server_id":18,"link":"photo_4364473.html","width":130,"caption":"Sheila Loughlin (oil)","height":197});
															thumbnails[4282099] = clik.newPhoto({"id":4282099,"src":"Limited-palette-Life-study_thumb.jpg","galleries_id":219010,"server_id":18,"link":"photo_4282099.html","width":130,"caption":"Limited palette Life study (oil)","height":85});
															thumbnails[3536889] = clik.newPhoto({"id":3536889,"src":"Vibrance-and-Sombreness_thumb.jpg","galleries_id":148105,"server_id":18,"link":"photo_3536889.html","width":130,"caption":"Vibrance and Sombreness (oil)","height":171});
															thumbnails[1141871] = clik.newPhoto({"id":1141871,"src":"Collectingsmall.jpg","galleries_id":82893,"server_id":18,"link":"photo_1141871.html","width":130,"caption":"Collecting Leaves  (oil)","height":92});
															thumbnails[1142076] = clik.newPhoto({"id":1142076,"src":"Crow-on-the-Wall-2_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_1142076.html","width":130,"caption":"Crow on the Wall (oil)","height":99});
															thumbnails[1142112] = clik.newPhoto({"id":1142112,"src":"Reading_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_1142112.html","width":130,"caption":"Reading the Saturday Supplement (oil)","height":161});
															thumbnails[1142124] = clik.newPhoto({"id":1142124,"src":"JapanGirlsmall.jpg","galleries_id":82893,"server_id":18,"link":"photo_1142124.html","width":75,"caption":"Head of Japanese Girl (oil)","height":104});
															thumbnails[1142129] = clik.newPhoto({"id":1142129,"src":"Away-with-it_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_1142129.html","width":130,"caption":"Busy (pencil)","height":85});
															thumbnails[1142594] = clik.newPhoto({"id":1142594,"src":"Head-of-Liam_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_1142594.html","width":130,"caption":"Study of Liam (oil)","height":151});
															thumbnails[1142790] = clik.newPhoto({"id":1142790,"src":"HouseofDreams.jpg","galleries_id":82893,"server_id":18,"link":"photo_1142790.html","width":130,"caption":"House of Dreams (oil)","height":170});
															thumbnails[1142792] = clik.newPhoto({"id":1142792,"src":"japaneseartistsmall.jpg","galleries_id":82893,"server_id":18,"link":"photo_1142792.html","width":105,"caption":"Japanese Street Artist (pencil)","height":133});
															thumbnails[1142819] = clik.newPhoto({"id":1142819,"src":"Head-of-Jim_thumb.jpg","galleries_id":82967,"server_id":18,"link":"photo_1142819.html","width":72,"caption":"A Man for All Seasons (pencil)","height":105});
															thumbnails[1142833] = clik.newPhoto({"id":1142833,"src":"John-Hibberts1.jpg","galleries_id":82967,"server_id":18,"link":"photo_1142833.html","width":130,"caption":"Portrait of John Hibbert (oil) ","height":74});
															thumbnails[1142936] = clik.newPhoto({"id":1142936,"src":"Dave-Smithsmall.jpg","galleries_id":82967,"server_id":18,"link":"photo_1142936.html","width":94,"caption":"Portrait of Dave SMith (oil)","height":141});
															thumbnails[1142943] = clik.newPhoto({"id":1142943,"src":"headrogeronesll.jpg","galleries_id":82967,"server_id":18,"link":"photo_1142943.html","width":64,"caption":"Head of Roger #1 (oil)","height":74});
															thumbnails[1142945] = clik.newPhoto({"id":1142945,"src":"My-place_thumb.jpg","galleries_id":82967,"server_id":18,"link":"photo_1142945.html","width":72,"caption":"My Place (pencil)","height":94});
															thumbnails[1142946] = clik.newPhoto({"id":1142946,"src":"The-Artist's-Mothesmall.jpg","galleries_id":82967,"server_id":18,"link":"photo_1142946.html","width":128,"caption":"The Artist's Mother (oil)","height":172});
															thumbnails[1142947] = clik.newPhoto({"id":1142947,"src":"Study-Chess-small.jpg","galleries_id":82967,"server_id":18,"link":"photo_1142947.html","width":74,"caption":"Study for The Chess Game (pencil)","height":103});
															thumbnails[1142956] = clik.newPhoto({"id":1142956,"src":"Roger-no1small.jpg","galleries_id":82973,"server_id":18,"link":"photo_1142956.html","width":72,"caption":"Roger #2 (oil)","height":96});
															thumbnails[1142957] = clik.newPhoto({"id":1142957,"src":"Roger-no2small.jpg","galleries_id":82973,"server_id":18,"link":"photo_1142957.html","width":81,"caption":"Roger #3 (oil)","height":99});
															thumbnails[1142962] = clik.newPhoto({"id":1142962,"src":"white-blue-dresssmall.jpg","galleries_id":82973,"server_id":18,"link":"photo_1142962.html","width":130,"caption":"White Dress, Blue Dress (oil)","height":107});
															thumbnails[1167838] = clik.newPhoto({"id":1167838,"src":"Ellie-windowsillsmall1.jpg","galleries_id":82967,"server_id":18,"link":"photo_1167838.html","width":105,"caption":"On the Windowsill (oil)","height":130});
															thumbnails[1255457] = clik.newPhoto({"id":1255457,"src":"head-roger2small.jpg","galleries_id":82973,"server_id":18,"link":"photo_1255457.html","width":100,"caption":"Head of Roger #2 (oil)","height":127});
															thumbnails[1255505] = clik.newPhoto({"id":1255505,"src":"head-roger3smalll.jpg","galleries_id":82973,"server_id":18,"link":"photo_1255505.html","width":125,"caption":"Head of Roger #3 (oil)","height":85});
															thumbnails[1359508] = clik.newPhoto({"id":1359508,"src":"Fruit-from-above-small.jpg","galleries_id":95161,"server_id":18,"link":"photo_1359508.html","width":130,"caption":"Fruit from Above (oil)","height":63});
															thumbnails[1359592] = clik.newPhoto({"id":1359592,"src":"On-the-lawn-small3.jpg","galleries_id":95161,"server_id":18,"link":"photo_1359592.html","width":130,"caption":"On the Lawn (oil)","height":107});
															thumbnails[1776994] = clik.newPhoto({"id":1776994,"src":"apples,-jug-&-pears1_thumb.jpg","galleries_id":95161,"server_id":18,"link":"photo_1776994.html","width":110,"caption":"Apples and Pears from Above<br>\r\n(oil)","height":81});
															thumbnails[1777018] = clik.newPhoto({"id":1777018,"src":"Busking-in-Amsterdam1_thumb.jpg","galleries_id":95161,"server_id":18,"link":"photo_1777018.html","width":130,"caption":"Busking in Amsterdam<br>\r\n(oil)","height":161});
															thumbnails[1777038] = clik.newPhoto({"id":1777038,"src":"The-Street-Statue3_thumb.jpg","galleries_id":95161,"server_id":18,"link":"photo_1777038.html","width":130,"caption":"The Street Statue<br>\r\n(oil)","height":126});
															thumbnails[2251478] = clik.newPhoto({"id":2251478,"src":"Chicken-Skin-Music_thumb.jpg","galleries_id":95161,"server_id":18,"link":"photo_2251478.html","width":130,"caption":"Chicken Skin Music - (oil)","height":178});
															thumbnails[2251533] = clik.newPhoto({"id":2251533,"src":"Reflection-A-Self-Portrai_thumb.jpg","galleries_id":148105,"server_id":18,"link":"photo_2251533.html","width":130,"caption":"Reflection - A Self Portrait (oil)","height":175});
															thumbnails[2873193] = clik.newPhoto({"id":2873193,"src":"The-Gate_thumb.jpg","galleries_id":95161,"server_id":18,"link":"photo_2873193.html","width":129,"caption":"The Gate (oil)","height":163});
															thumbnails[2873224] = clik.newPhoto({"id":2873224,"src":"Going-my-Way_thumb.jpg","galleries_id":82973,"server_id":18,"link":"photo_2873224.html","width":130,"caption":"Going My Way (pencil)","height":83});
															thumbnails[2873239] = clik.newPhoto({"id":2873239,"src":"The-Chess-Game_thumb.jpg","galleries_id":82973,"server_id":18,"link":"photo_2873239.html","width":130,"caption":"The Chess Game (oil)","height":153});
															thumbnails[3037533] = clik.newPhoto({"id":3037533,"src":"Victoria_thumb.jpg","galleries_id":148105,"server_id":18,"link":"photo_3037533.html","width":130,"caption":"Victoria (oil)","height":96});
															thumbnails[3037536] = clik.newPhoto({"id":3037536,"src":"Solboy_thumb.jpg","galleries_id":148105,"server_id":18,"link":"photo_3037536.html","width":130,"caption":"Solboy (oil)","height":182});
															thumbnails[3037559] = clik.newPhoto({"id":3037559,"src":"Willie_thumb.jpg","galleries_id":148105,"server_id":18,"link":"photo_3037559.html","width":130,"caption":"Willie (oil)","height":182});
															thumbnails[3037562] = clik.newPhoto({"id":3037562,"src":"The-Easter-Egg-Hunt-1_thumb.jpg","galleries_id":148105,"server_id":18,"link":"photo_3037562.html","width":130,"caption":"The Easter Egg Hunt (oil)","height":101});
															thumbnails[3059694] = clik.newPhoto({"id":3059694,"src":"The-Black-Shawl_thumb.jpg","galleries_id":219010,"server_id":18,"link":"photo_3059694.html","width":130,"caption":"The Black Shawl (oil)","height":55});
															thumbnails[3059700] = clik.newPhoto({"id":3059700,"src":"Nude-with-Pink_thumb.jpg","galleries_id":219010,"server_id":18,"link":"photo_3059700.html","width":130,"caption":"Nude with Pink (oil)","height":127});
															thumbnails[3583301] = clik.newPhoto({"id":3583301,"src":"Hannah_thumb.jpg","galleries_id":95161,"server_id":18,"link":"photo_3583301.html","width":130,"caption":"Hannah","height":93});
															thumbnails[3583322] = clik.newPhoto({"id":3583322,"src":"Preparing1_thumb.jpg","galleries_id":219010,"server_id":18,"link":"photo_3583322.html","width":130,"caption":"Preparation pour le rendez-vous (pencil)","height":173});
															thumbnails[7260353] = clik.newPhoto({"id":7260353,"src":"Laughter-_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_7260353.html","width":130,"caption":"Laughter (oil)","height":103});
															thumbnails[8014496] = clik.newPhoto({"id":8014496,"src":"Girl-on-a-Swing_thumb.jpg","galleries_id":82967,"server_id":18,"link":"photo_8014496.html","width":130,"caption":"Girl on a Swing (oil)","height":221});
															thumbnails[7637319] = clik.newPhoto({"id":7637319,"src":"Portrait-of-An-English-Rose_thumb.jpg","galleries_id":82967,"server_id":18,"link":"photo_7637319.html","width":130,"caption":"Portait of An English Rose (oil)","height":191});
															thumbnails[6218880] = clik.newPhoto({"id":6218880,"src":"The-Black-Shawl2_thumb.jpg","galleries_id":219010,"server_id":18,"link":"photo_6218880.html","width":130,"caption":"The Black Shawl #2 (oil)","height":75});
															thumbnails[7525266] = clik.newPhoto({"id":7525266,"src":"Hair-up-or-down_thumb.jpg","galleries_id":219010,"server_id":18,"link":"photo_7525266.html","width":130,"caption":"Hair up or down (pencil)","height":97});
															thumbnails[5680431] = clik.newPhoto({"id":5680431,"src":"Mikey-Dudley-and-Oscar_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_5680431.html","width":130,"caption":"Mikey with his dogs Dudley and Oscar<br>\r\n(oil)","height":95});
															thumbnails[5818606] = clik.newPhoto({"id":5818606,"src":"Graduation-Conversation_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_5818606.html","width":130,"caption":"Graduation Conversation (oil)","height":100});
															thumbnails[8233262] = clik.newPhoto({"id":8233262,"src":"Gigha-and-Hazel-final_thumb.jpg","galleries_id":82967,"server_id":18,"link":"photo_8233262.html","width":130,"caption":"The Two Sisters (oil)","height":190});
															thumbnails[8561863] = clik.newPhoto({"id":8561863,"src":"Kirsty-web_thumb.jpg","galleries_id":82967,"server_id":18,"link":"photo_8561863.html","width":130,"caption":"Kirsty (oil)","height":90});
															thumbnails[6624325] = clik.newPhoto({"id":6624325,"src":"Ellie-and-Ozzi_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_6624325.html","width":130,"caption":"Ellie and Ozzi (oil)","height":163});
															thumbnails[7364219] = clik.newPhoto({"id":7364219,"src":"Eric-Goose_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_7364219.html","width":130,"caption":"Air Commodore EJT Goose MA (oil)","height":144});
															thumbnails[7525263] = clik.newPhoto({"id":7525263,"src":"Hazel-giraffe-teddy_thumb.jpg","galleries_id":82893,"server_id":18,"link":"photo_7525263.html","width":130,"caption":"Hazel, Giraffe and Teddy (oil)","height":189});
															thumbnails[8791912] = clik.newPhoto({"id":8791912,"src":"Foggy-day-Cairnsmore1_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_8791912.html","width":130,"caption":"Foggy day over Cairnsmore#1","height":196});
															thumbnails[8792239] = clik.newPhoto({"id":8792239,"src":"Moon-study-late-afternon_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_8792239.html","width":130,"caption":"Moon study late afternoon","height":86});
															thumbnails[8792340] = clik.newPhoto({"id":8792340,"src":"Sunset-over-the-mist_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_8792340.html","width":130,"caption":"Sunset over the mist","height":86});
															thumbnails[8916325] = clik.newPhoto({"id":8916325,"src":"Machars-cloud-study1_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_8916325.html","width":130,"caption":"Machars cloud study #1","height":86});
															thumbnails[8916329] = clik.newPhoto({"id":8916329,"src":"Machars-cloud-study2_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_8916329.html","width":130,"caption":"Machars cloud study #2","height":86});
															thumbnails[9009578] = clik.newPhoto({"id":9009578,"src":"Loch-Grannoch_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_9009578.html","width":130,"caption":"Loch Grannoch","height":196});
															thumbnails[9009584] = clik.newPhoto({"id":9009584,"src":"Loch-of-Lowes-study_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_9009584.html","width":130,"caption":"Loch of Lowes study","height":196});
															thumbnails[8792300] = clik.newPhoto({"id":8792300,"src":"Spiders-web-and-mist_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_8792300.html","width":130,"caption":"Spiders web and mist","height":86});
															thumbnails[8791799] = clik.newPhoto({"id":8791799,"src":"Dry-stone-wall-study_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_8791799.html","width":130,"caption":"Dry stone wall study","height":86});
															thumbnails[8791924] = clik.newPhoto({"id":8791924,"src":"Foggy-day-Cairnsmore2_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_8791924.html","width":130,"caption":"Foggy day over Cairnsmore#2","height":86});
															thumbnails[8792260] = clik.newPhoto({"id":8792260,"src":"Mosshead-Cairnsmore_thumb.jpg","galleries_id":462931,"server_id":18,"link":"photo_8792260.html","width":130,"caption":"Moss head","height":196});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[82893] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery One ","link":"gallery_82893.html","maxRecords":0.0,"photoIDs":[5680422.0,1141871.0,1142076.0,1142112.0,1142124.0,1142129.0,1142594.0,1142790.0,1142792.0,7260353.0,5680431.0,5818606.0,6624325.0,7364219.0,7525263.0],"skipIndex":0,"section_code":"gallery","featured_images":"7525263,7364219,7260353,6624325,5818606,5680431,5680422,1142792,1142790,1142594","id":82893,"singleSection":false});				  						galleries[82967] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery Two","link":"gallery_82967.html","maxRecords":0.0,"photoIDs":[1142819.0,1142833.0,1142936.0,1142943.0,1142945.0,1142946.0,1142947.0,1167838.0,8014496.0,7637319.0,8233262.0,8561863.0],"skipIndex":0,"section_code":"gallery","featured_images":"8561863,8233262,8014496,7637319,1167838,1142947,1142946,1142945,1142943,1142936","id":82967,"singleSection":false});				  						galleries[82973] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery Three","link":"gallery_82973.html","maxRecords":0.0,"photoIDs":[5498057.0,1142956.0,1142957.0,1142962.0,1255457.0,1255505.0,2873224.0,2873239.0],"skipIndex":0,"section_code":"gallery","featured_images":"5498057,2873239,2873224,1255505,1255457,1142962,1142957,1142956","id":82973,"singleSection":false});				  						galleries[95161] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery Four","link":"gallery_95161.html","maxRecords":0.0,"photoIDs":[1359508.0,1359592.0,1776994.0,1777018.0,1777038.0,2251478.0,2873193.0,3583301.0],"skipIndex":0,"section_code":"gallery","featured_images":"3583301,2873193,2251478,1777038,1777018,1776994,1359592,1359508","id":95161,"singleSection":false});				  						galleries[148105] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery Five","link":"gallery_148105.html","maxRecords":0.0,"photoIDs":[4607740.0,4364473.0,3536889.0,2251533.0,3037533.0,3037536.0,3037559.0,3037562.0],"skipIndex":0,"section_code":"gallery","featured_images":"4607740,4364473,3536889,3037562,3037559,3037536,3037533,2251533","id":148105,"singleSection":false});				  						galleries[219010] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery Six","link":"gallery_219010.html","maxRecords":0.0,"photoIDs":[4607739.0,4282099.0,3059694.0,3059700.0,3583322.0,6218880.0,7525266.0],"skipIndex":0,"section_code":"gallery","featured_images":"7525266,6218880,4607739,4282099,3583322,3059700,3059694","id":219010,"singleSection":false});				  						galleries[462931] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photo Gallery One","link":"section560470.html","maxRecords":0.0,"photoIDs":[8791912.0,8792239.0,8792340.0,8916325.0,8916329.0,9009578.0,9009584.0,8792300.0,8791799.0,8791924.0,8792260.0],"skipIndex":0,"section_code":"section560470","featured_images":"9009584,9009578,8916329,8916325,8792340,8792300,8792260,8792239,8791924,8791912","id":462931,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1141908';
imageSets[2] = '1141939';
imageSets[3] = '9009584,9009578,8916329,8916325,8792340,8792300,8792260,8792239,8791924,8791912,8791799,8561863,8233262,8014496,7637319,7525266,7525263,7364219,7260353,6624325,6218880,5818606,5680431,5680422,5498057,4607740,4607739,4364473,4282099,3583322,3583301,3536889,3059700,3059694,3037562,3037559,3037536,3037533,2873239,2873224,2873193,2251533,2251478,1777038,1777018,1776994,1359592,1359508,1255505,1255457';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/garyc/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/garyc/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/garyc/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/garyc/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/garyc/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/garyc/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/garyc/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/garyc/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 = 'Gary Craig Gallery: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			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;
	}
}

			

