window.thumbnails = {};
															thumbnails[8551642] = clik.newPhoto({"id":8551642,"src":"MountainsJoan.jpg__thumb.jpg","galleries_id":27475,"server_id":37,"link":"photo_8551642.html","width":130,"caption":"Scottish mountains by Joan Ashcroft","height":183});
															thumbnails[8551646] = clik.newPhoto({"id":8551646,"src":"PeekingJoan_thumb.jpg","galleries_id":27475,"server_id":37,"link":"photo_8551646.html","width":130,"caption":"Peeking through the trees at the River Tay by Joan Ashcroft","height":61});
															thumbnails[8551651] = clik.newPhoto({"id":8551651,"src":"OwlEyesJoan_thumb.jpg","galleries_id":27475,"server_id":37,"link":"photo_8551651.html","width":130,"caption":"Owl eyes by Joan Ashcroft","height":122});
															thumbnails[323054] = clik.newPhoto({"id":323054,"src":"Anne Wilson - Boating Station, Faskally Loch, Pitlochry_thumb..jpg","galleries_id":27474,"server_id":18,"link":"photo_323054.html","width":130,"caption":"Anne Wilson - Boating Station, Pitlochry","height":85});
															thumbnails[323063] = clik.newPhoto({"id":323063,"src":"Moray Coast - Acrylic_thumb. Linda Lincoln.jpg","galleries_id":27475,"server_id":18,"link":"photo_323063.html","width":130,"caption":"Linda Lincoln - Moray Coast","height":88});
															thumbnails[334806] = clik.newPhoto({"id":334806,"src":"St_thumb.Monan's Kirk by Jim Bowman.jpg","galleries_id":27474,"server_id":18,"link":"photo_334806.html","width":130,"caption":"St Monan's Kirk by Jim Bowman","height":93});
															thumbnails[334811] = clik.newPhoto({"id":334811,"src":"Acrylic Display_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_334811.html","width":130,"caption":"Photographic Greeting Cards by Jan Moles","height":112});
															thumbnails[340121] = clik.newPhoto({"id":340121,"src":"Crathie Kirk by Jim Bowman_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_340121.html","width":130,"caption":"Crathie Kirk by Jim Bowman","height":94});
															thumbnails[345346] = clik.newPhoto({"id":345346,"src":"His & Hers Ron Forbes_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_345346.html","width":130,"caption":"His & Hers by Ron Forbes","height":93});
															thumbnails[1030488] = clik.newPhoto({"id":1030488,"src":"MFS Lg Poppy Group copy_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_1030488.html","width":130,"caption":"Field Edge","height":167});
															thumbnails[1498943] = clik.newPhoto({"id":1498943,"src":"Inveroran_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_1498943.html","width":130,"caption":"Inveroran<br>\r\nby Pat Gibb","height":94});
															thumbnails[5757083] = clik.newPhoto({"id":5757083,"src":"stationcatsandbrooches_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_5757083.html","width":130,"caption":"Station Cat Pottery - Fiona Gordon","height":132});
															thumbnails[5757139] = clik.newPhoto({"id":5757139,"src":"019_thumb.JPG","galleries_id":27478,"server_id":18,"link":"photo_5757139.html","width":130,"caption":"Knitwear by Na'an Meikleour","height":86});
															thumbnails[5757143] = clik.newPhoto({"id":5757143,"src":"026_thumb.JPG","galleries_id":27478,"server_id":18,"link":"photo_5757143.html","width":130,"caption":"Produce by: Scottish Preserves","height":93});
															thumbnails[5757148] = clik.newPhoto({"id":5757148,"src":"030_thumb.JPG","galleries_id":27478,"server_id":18,"link":"photo_5757148.html","width":130,"caption":"Crafts by: Peter Leigh","height":96});
															thumbnails[5757150] = clik.newPhoto({"id":5757150,"src":"033_thumb.JPG","galleries_id":27478,"server_id":18,"link":"photo_5757150.html","width":130,"caption":"Handmade Greetings Cards by: Helen Porter","height":73});
															thumbnails[5757152] = clik.newPhoto({"id":5757152,"src":"037_thumb.JPG","galleries_id":27472,"server_id":18,"link":"photo_5757152.html","width":130,"caption":"Pitlochry Gallery","height":86});
															thumbnails[5757194] = clik.newPhoto({"id":5757194,"src":"H110F_thumb.JPG","galleries_id":27478,"server_id":18,"link":"photo_5757194.html","width":130,"caption":"Handmade Greetings Cards by Helen Porter","height":130});
															thumbnails[5757200] = clik.newPhoto({"id":5757200,"src":"101_0250-21_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_5757200.html","width":130,"caption":"Station Cat Pottery by Fiona Gordon","height":174});
															thumbnails[5818611] = clik.newPhoto({"id":5818611,"src":"Proud_Mother_thumb.jpg","galleries_id":27476,"server_id":18,"link":"photo_5818611.html","width":130,"caption":"Proud Mother by Trevor Taylor","height":205});
															thumbnails[5818613] = clik.newPhoto({"id":5818613,"src":"Stallion_thumb.jpg","galleries_id":27476,"server_id":18,"link":"photo_5818613.html","width":130,"caption":"Stallion by Trevor Taylor","height":114});
															thumbnails[5818615] = clik.newPhoto({"id":5818615,"src":"Torrin_thumb.jpg","galleries_id":27476,"server_id":18,"link":"photo_5818615.html","width":130,"caption":"Torrin, Isle of Sky by Trevor Taylor","height":97});
															thumbnails[334805] = clik.newPhoto({"id":334805,"src":"_Holyrood Palace by Jim Bowman_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_334805.html","width":130,"caption":"Holyrood Palace by Jim Bowman","height":94});
															thumbnails[363677] = clik.newPhoto({"id":363677,"src":"_7170776_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_363677.html","width":130,"caption":"Bobby in Greyfriar's Churchyard","height":95});
															thumbnails[478398] = clik.newPhoto({"id":478398,"src":"Blue Studio by Peter Green_thumb.jpg","galleries_id":27475,"server_id":18,"link":"photo_478398.html","width":130,"caption":"Blue Studio by Peter Green","height":130});
															thumbnails[478404] = clik.newPhoto({"id":478404,"src":"Lunch at the studio by Peter Green_thumb.jpg","galleries_id":27475,"server_id":18,"link":"photo_478404.html","width":130,"caption":"Lunch at the Studio by Peter Green","height":181});
															thumbnails[494867] = clik.newPhoto({"id":494867,"src":"OMIHT_thumb.jpg","galleries_id":27476,"server_id":18,"link":"photo_494867.html","width":130,"caption":"One Man in his Time<br>\r\nby Jim Bowman","height":179});
															thumbnails[340119] = clik.newPhoto({"id":340119,"src":"Atholl Centre Entrance_thumb.jpg","galleries_id":27472,"server_id":18,"link":"photo_340119.html","width":130,"caption":"Atholl Centre Entrance","height":97});
															thumbnails[342993] = clik.newPhoto({"id":342993,"src":"Festival Theatre & Dam, Pitlochry_thumb. Anne Wilson.jpg","galleries_id":27474,"server_id":18,"link":"photo_342993.html","width":130,"caption":"Festival Theatre & Dam, Pitlochry. Anne Wilson","height":96});
															thumbnails[345300] = clik.newPhoto({"id":345300,"src":"Still Life with Fruit Ron Forbes_thumb.jpg","galleries_id":27475,"server_id":18,"link":"photo_345300.html","width":130,"caption":"Still Life with Fruit by Ron Forbes","height":91});
															thumbnails[363683] = clik.newPhoto({"id":363683,"src":"_7170823_thumb.jpg","galleries_id":27475,"server_id":18,"link":"photo_363683.html","width":130,"caption":"Festival Theatre, Pitlochy - Philip Greene","height":96});
															thumbnails[1030480] = clik.newPhoto({"id":1030480,"src":"Multi Mecon WEB_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_1030480.html","width":130,"caption":"Meconopsis (multi heads)","height":93});
															thumbnails[1076386] = clik.newPhoto({"id":1076386,"src":"Peet - Bargello Jewellery Box_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_1076386.html","width":130,"caption":"Bargello Jewellery Box<br>\r\nby Karl Peet","height":98});
															thumbnails[1076582] = clik.newPhoto({"id":1076582,"src":"Jim Waite - Glass & Pyrography_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_1076582.html","width":130,"caption":"Pyrography and engraved glass<br>\r\nby Jim Waite","height":173});
															thumbnails[2359274] = clik.newPhoto({"id":2359274,"src":"2007-11-26-1814-55_thumb.jpg","galleries_id":27475,"server_id":18,"link":"photo_2359274.html","width":130,"caption":"Kintyre Shore<br>\r\n<br>\r\nby Sharon MacDonald","height":95});
															thumbnails[1076425] = clik.newPhoto({"id":1076425,"src":"Peet - Industrial Art - Jewellery Box_thumb.JPG","galleries_id":27478,"server_id":18,"link":"photo_1076425.html","width":130,"caption":"Industrial Art Jewellery Box <br>\r\nby Karl Peet","height":98});
															thumbnails[345123] = clik.newPhoto({"id":345123,"src":"Gentle Giant Ron Forbes copy_thumb.jpg","galleries_id":27475,"server_id":18,"link":"photo_345123.html","width":130,"caption":"Gentle Giant by Ron Forbes-Oil","height":107});
															thumbnails[345360] = clik.newPhoto({"id":345360,"src":"untitled Ron Forbes_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_345360.html","width":130,"caption":"Soup Kitchen","height":91});
															thumbnails[363686] = clik.newPhoto({"id":363686,"src":"_7170834_thumb.jpg","galleries_id":27476,"server_id":18,"link":"photo_363686.html","width":130,"caption":"Garden Door with Irises by Karin D. Scott","height":118});
															thumbnails[363687] = clik.newPhoto({"id":363687,"src":"_7170836_thumb.jpg","galleries_id":27476,"server_id":18,"link":"photo_363687.html","width":130,"caption":"Green Lane, Yorkshire by Karin D. Scott","height":93});
															thumbnails[1030470] = clik.newPhoto({"id":1030470,"src":"MFS Redheads_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_1030470.html","width":130,"caption":"Redheads","height":172});
															thumbnails[1030474] = clik.newPhoto({"id":1030474,"src":"Golden Eagle MFS_thumb.jpg","galleries_id":27476,"server_id":18,"link":"photo_1030474.html","width":130,"caption":"Golden Eagle","height":121});
															thumbnails[1076431] = clik.newPhoto({"id":1076431,"src":"Peet - Keepdake box in Yew_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_1076431.html","width":130,"caption":"Keepsake Box in Yew<br>\r\nby Karl Peet","height":98});
															thumbnails[1076581] = clik.newPhoto({"id":1076581,"src":"Jim Waite - Engraved Glass_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_1076581.html","width":130,"caption":"Engraved Glass by Jim Waite","height":193});
															thumbnails[1076583] = clik.newPhoto({"id":1076583,"src":"Julie Hay - Jules Jewellery_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_1076583.html","width":130,"caption":"Jewellery by Julie Hay","height":84});
															thumbnails[6437763] = clik.newPhoto({"id":6437763,"src":"Fernsheart_thumb.jpg","galleries_id":27477,"server_id":18,"link":"photo_6437763.html","width":130,"caption":"Fernsheart by Jo Cound","height":181});
															thumbnails[6437771] = clik.newPhoto({"id":6437771,"src":"Hermitage-FallsBraan_thumb.jpg","galleries_id":27477,"server_id":18,"link":"photo_6437771.html","width":130,"caption":"Hermitage-Falls Braan by Jo Cound","height":88});
															thumbnails[6437776] = clik.newPhoto({"id":6437776,"src":"InkCapAcer_thumb.jpg","galleries_id":27477,"server_id":18,"link":"photo_6437776.html","width":130,"caption":"Ink Cap & Acer","height":180});
															thumbnails[323065] = clik.newPhoto({"id":323065,"src":"kintyrejune 2006_thumb.Linda Lincoln.jpg","galleries_id":27474,"server_id":18,"link":"photo_323065.html","width":130,"caption":"Sharon MacDonald    Kintyre,June","height":97});
															thumbnails[341482] = clik.newPhoto({"id":341482,"src":"mallardswatercolour_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_341482.html","width":130,"caption":"Mallards by Sharon MacDonald","height":96});
															thumbnails[342998] = clik.newPhoto({"id":342998,"src":"Still Life2 by Kate Kirby_thumb.jpg","galleries_id":27475,"server_id":18,"link":"photo_342998.html","width":130,"caption":"Still Life (blue table) by Kate Kirby","height":98});
															thumbnails[348612] = clik.newPhoto({"id":348612,"src":"OLDCOURSEINWINTER_thumb.jpg","galleries_id":27477,"server_id":18,"link":"photo_348612.html","width":130,"caption":"Old Course in Winter<br>\r\nStan Farrow Photography","height":89});
															thumbnails[351489] = clik.newPhoto({"id":351489,"src":"Yvonne Arton Blairgowrie_2_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_351489.html","width":130,"caption":"Yvonne Arton, Blairgowrie","height":148});
															thumbnails[351490] = clik.newPhoto({"id":351490,"src":"Yvonne Arton Blairgowrie_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_351490.html","width":130,"caption":"Yvonne Arton, Blairgowrie","height":211});
															thumbnails[478401] = clik.newPhoto({"id":478401,"src":"Birksforweb_thumb.jpg","galleries_id":27477,"server_id":18,"link":"photo_478401.html","width":130,"caption":"The Birks of Aberfeldy<br>\r\nStan Farrow Photography","height":194});
															thumbnails[478407] = clik.newPhoto({"id":478407,"src":"Lion at the gate, Mains of Edradour_thumb.JPG","galleries_id":27477,"server_id":18,"link":"photo_478407.html","width":130,"caption":"Lion at the Gate<br>\r\nMains of Edradour<br>\r\nPhotograph by Jan Moles","height":173});
															thumbnails[478411] = clik.newPhoto({"id":478411,"src":"The Salmon Leap & Falls of Tummel_thumb.jpg","galleries_id":27476,"server_id":18,"link":"photo_478411.html","width":130,"caption":"The Salmon Leap & Falls of Tummel<br>\r\nGraphite drawing by Alfred Marsh","height":93});
															thumbnails[1062549] = clik.newPhoto({"id":1062549,"src":"FIRSTLIGHT_thumb.jpg","galleries_id":27477,"server_id":18,"link":"photo_1062549.html","width":130,"caption":"First Light","height":77});
															thumbnails[1062550] = clik.newPhoto({"id":1062550,"src":"NOCTURNE_thumb.jpg","galleries_id":27477,"server_id":18,"link":"photo_1062550.html","width":130,"caption":"Nocturne","height":64});
															thumbnails[1062551] = clik.newPhoto({"id":1062551,"src":"SOLITUDE_thumb.jpg","galleries_id":27477,"server_id":18,"link":"photo_1062551.html","width":130,"caption":"Solitude","height":73});
															thumbnails[1498942] = clik.newPhoto({"id":1498942,"src":"Sunset over Holy Isle, Arran_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_1498942.html","width":130,"caption":"Sunset over Holy Isle, Arran<br>\r\nby Pat Gibb","height":129});
															thumbnails[2359276] = clik.newPhoto({"id":2359276,"src":"DSC00315_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_2359276.html","width":130,"caption":"Eilean Donan Castle<br>\r\n<br>\r\nby Sharon MacDonald","height":98});
															thumbnails[6437754] = clik.newPhoto({"id":6437754,"src":"DSC_5121croppedcompressed_thumb.jpg","galleries_id":27478,"server_id":18,"link":"photo_6437754.html","width":130,"caption":"Knitwear by Pandora Gill","height":159});
															thumbnails[351464] = clik.newPhoto({"id":351464,"src":"Delphinium Head (buds) Jan Moles_thumb.jpg","galleries_id":27477,"server_id":18,"link":"photo_351464.html","width":130,"caption":"Delphinium Head (buds) Jan Moles","height":173});
															thumbnails[1030483] = clik.newPhoto({"id":1030483,"src":"Osprey Head_thumb.jpg","galleries_id":27476,"server_id":18,"link":"photo_1030483.html","width":130,"caption":"Osprey Head","height":158});
															thumbnails[323062] = clik.newPhoto({"id":323062,"src":"Anne Wilson - Pennan,Cullykhan Bay_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_323062.html","width":130,"caption":"Anne Wilson - Pennan,Cullykhan Bay","height":103});
															thumbnails[340120] = clik.newPhoto({"id":340120,"src":"Loch an Eilean by Jim Bowman_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_340120.html","width":130,"caption":"Loch an Eilean by Jim Bowman","height":99});
															thumbnails[348605] = clik.newPhoto({"id":348605,"src":"charlie_thumb.jpg","galleries_id":27475,"server_id":18,"link":"photo_348605.html","width":130,"caption":"Charlie by Dawn Brooks","height":103});
															thumbnails[363682] = clik.newPhoto({"id":363682,"src":"_7170806_thumb.jpg","galleries_id":27474,"server_id":18,"link":"photo_363682.html","width":130,"caption":"Highland Cattle on Skye by Ron Forbes","height":96});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[27472] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Summer\/Autumn Exhibitions","link":"gallery_27472.html","maxRecords":0.0,"photoIDs":[5757152.0,340119.0],"skipIndex":0,"section_code":"gallery","featured_images":"5757152,340119","id":27472,"singleSection":false});				  						galleries[27474] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Watercolour - Gallery 1","link":"gallery_27474.html","maxRecords":0.0,"photoIDs":[323054.0,334806.0,340121.0,345346.0,1030488.0,1498943.0,334805.0,363677.0,342993.0,1030480.0,345360.0,1030470.0,323065.0,341482.0,1498942.0,2359276.0,323062.0,340120.0,363682.0],"skipIndex":0,"section_code":"gallery","featured_images":"1030488,1030480,1030470,363682,345346,341482,334805,323062,323054","id":27474,"singleSection":false});				  						galleries[27475] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Acrylic & Oil - Gallery 2","link":"gallery_27475.html","maxRecords":0.0,"photoIDs":[8551642.0,8551646.0,8551651.0,323063.0,478398.0,478404.0,345300.0,363683.0,2359274.0,345123.0,342998.0,348605.0],"skipIndex":0,"section_code":"gallery","featured_images":"2359274,478398,363683,348605,345300,345123,342998,323063","id":27475,"singleSection":false});				  						galleries[27476] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Mixed Media - Gallery 3","link":"gallery_27476.html","maxRecords":0.0,"photoIDs":[5818611.0,5818613.0,5818615.0,494867.0,363686.0,363687.0,1030474.0,478411.0,1030483.0],"skipIndex":0,"section_code":"gallery","featured_images":"1030483,1030474,494867,478411,363686","id":27476,"singleSection":false});				  						galleries[27477] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photography - Gallery 4","link":"gallery_27477.html","maxRecords":0.0,"photoIDs":[6437763.0,6437771.0,6437776.0,348612.0,478401.0,478407.0,1062549.0,1062550.0,1062551.0,351464.0],"skipIndex":0,"section_code":"gallery","featured_images":"6437763,1062550,1062549,478407,351464,348612","id":27477,"singleSection":false});				  						galleries[27478] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Crafts - Gallery 5","link":"gallery_27478.html","maxRecords":0.0,"photoIDs":[334811.0,5757083.0,5757139.0,5757143.0,5757148.0,5757150.0,5757194.0,5757200.0,1076386.0,1076582.0,1076425.0,1076431.0,1076581.0,1076583.0,351489.0,351490.0,6437754.0],"skipIndex":0,"section_code":"gallery","featured_images":"1076583,1076582,1076431,1076386,351490,351489,334811","id":27478,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1030488,345346,323063,323054,494867,478404,478398,363677,334805,2359274,1030480,363683,345300,342993,1076583,1076431,1030474,1030470,363687,363686,345123,6437771,1062551,1062549,478411,478401,351490,348612,342998,341482,323065,363682,323062';
imageSets[2] = '1030488,345346,334811,323063,323054,494867,478398,334805,2359274,1076582,1076386,1030480,363683,345300,1076583,1076431,1030474,1030470,363686,345123,6437763,1062550,1062549,478411,478407,351490,351489,348612,342998,341482,1030483,351464,363682,348605,323062';
imageSets[3] = '8551651,8551646,8551642,6437776,6437771,6437763,6437754,5818615,5818613,5818611,5757200,5757194,5757152,5757150,5757148,5757143,5757139,5757083,2359276,2359274,1498943,1498942,1076583,1076582,1076581,1076431,1076425,1076386,1062551,1062550,1062549,1030488,1030483,1030480,1030474,1030470,494867,478411,478407,478404,478401,478398,363687,363686,363683,363682,363677,351490,351489,351464';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/pgallery/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/pgallery/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/pgallery/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/pgallery/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/pgallery/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/pgallery/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/pgallery/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 = 'Pitlochry Gallery Association: ' + 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.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 += '<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;
	}
}

			

