window.thumbnails = {};
															thumbnails[675590] = clik.newPhoto({"id":675590,"src":"010_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Glen Bruar","height":87});
															thumbnails[2359034] = clik.newPhoto({"id":2359034,"src":"RHS Day 4 (193)_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"This is 'normal' Chime!!!","height":87});
															thumbnails[3719110] = clik.newPhoto({"id":3719110,"src":"Modified_pic_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"ADWPCEG Spring Show","height":125});
															thumbnails[4423968] = clik.newPhoto({"id":4423968,"src":"DSC_0150_edit_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Always have fun!!!!!!!","height":87});
															thumbnails[6552186] = clik.newPhoto({"id":6552186,"src":"DSC_0098_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Pride and Dexter","height":87});
															thumbnails[7717987] = clik.newPhoto({"id":7717987,"src":"29042011655_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Sleepy girl","height":98});
															thumbnails[8072409] = clik.newPhoto({"id":8072409,"src":"Mare_and_foal_3_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Ellie's first show","height":107});
															thumbnails[8177784] = clik.newPhoto({"id":8177784,"src":"DSCN5465_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"July 21 ","height":98});
															thumbnails[8177805] = clik.newPhoto({"id":8177805,"src":"DSCN5474_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"July 21","height":98});
															thumbnails[8266088] = clik.newPhoto({"id":8266088,"src":"DSCN5501_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"July 2011","height":98});
															thumbnails[8266092] = clik.newPhoto({"id":8266092,"src":"DSCN5502_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"July 2011","height":98});
															thumbnails[8266093] = clik.newPhoto({"id":8266093,"src":"DSCN5516_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"July 2011","height":98});
															thumbnails[8318653] = clik.newPhoto({"id":8318653,"src":"Foal_1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"18 August","height":102});
															thumbnails[8318662] = clik.newPhoto({"id":8318662,"src":"Foal_5_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"18 August","height":121});
															thumbnails[8322912] = clik.newPhoto({"id":8322912,"src":"Pride_1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"19 August 2011","height":108});
															thumbnails[8322914] = clik.newPhoto({"id":8322914,"src":"Pride_2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"18 August","height":98});
															thumbnails[8322917] = clik.newPhoto({"id":8322917,"src":"Pride_4_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"19 August","height":114});
															thumbnails[8322919] = clik.newPhoto({"id":8322919,"src":"Pride_6_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"19 August","height":189});
															thumbnails[8322920] = clik.newPhoto({"id":8322920,"src":"Pride_7_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"19 August","height":121});
															thumbnails[6301823] = clik.newPhoto({"id":6301823,"src":"Day1122_thumb.jpg","galleries_id":320896,"server_id":1,"link":"photo_6301823.html","width":130,"caption":"Winner of 3yo filly class","height":84});
															thumbnails[6461926] = clik.newPhoto({"id":6461926,"src":"DSC_0104_thumb.JPG","galleries_id":320896,"server_id":1,"link":"photo_6461926.html","width":130,"caption":"Nairn Show 2010 - Champion<br>\r\n<br>\r\nLochlands Silver Chime","height":87});
															thumbnails[8290464] = clik.newPhoto({"id":8290464,"src":"JessieJ1_thumb.jpg","galleries_id":320896,"server_id":1,"link":"photo_8290464.html","width":130,"caption":"GB Genesis","height":76});
															thumbnails[8290468] = clik.newPhoto({"id":8290468,"src":"JessieJ31_thumb.jpg","galleries_id":320896,"server_id":1,"link":"photo_8290468.html","width":130,"caption":"GB Genesis","height":206});
															thumbnails[7521560] = clik.newPhoto({"id":7521560,"src":"Misty_4_thumb.jpg","galleries_id":135836,"server_id":1,"link":"photo_7521560.html","width":130,"caption":"","height":87});
															thumbnails[7746403] = clik.newPhoto({"id":7746403,"src":"DSCN5083_thumb.JPG","galleries_id":135836,"server_id":1,"link":"photo_7746403.html","width":130,"caption":"Beautiful girl......","height":96});
															thumbnails[8072415] = clik.newPhoto({"id":8072415,"src":"Mare_and_foal_4_thumb.jpg","galleries_id":135836,"server_id":1,"link":"photo_8072415.html","width":130,"caption":"Pretty girl at NWHS, Brodie Castle","height":109});
															thumbnails[8072417] = clik.newPhoto({"id":8072417,"src":"Mare_and_foal_5_thumb.jpg","galleries_id":135836,"server_id":1,"link":"photo_8072417.html","width":130,"caption":"Reserve Champion, at Brodie Castle","height":105});
															thumbnails[8318664] = clik.newPhoto({"id":8318664,"src":"Moo_1_thumb.jpg","galleries_id":135836,"server_id":1,"link":"photo_8318664.html","width":130,"caption":"Moo on 18 August 2011","height":112});
															thumbnails[2204264] = clik.newPhoto({"id":2204264,"src":"chime_pic_sfcs_(3)_thumb.jpg","galleries_id":135837,"server_id":1,"link":"photo_2204264.html","width":130,"caption":"My girl!!","height":107});
															thumbnails[2612167] = clik.newPhoto({"id":2612167,"src":"Keith Show (49)_thumb.JPG","galleries_id":135837,"server_id":1,"link":"photo_2612167.html","width":130,"caption":"Chime is 1st at Keith Show","height":87});
															thumbnails[4423971] = clik.newPhoto({"id":4423971,"src":"DSC_0070_edit_thumb.jpg","galleries_id":135837,"server_id":1,"link":"photo_4423971.html","width":130,"caption":"Champion Highland, Best Native and Reserve Overall - Nairn Show","height":87});
															thumbnails[4693960] = clik.newPhoto({"id":4693960,"src":"Royal_Highland_Show_2009_thumb.jpg","galleries_id":135837,"server_id":1,"link":"photo_4693960.html","width":130,"caption":"2nd in 2yo filly class","height":97});
															thumbnails[6301817] = clik.newPhoto({"id":6301817,"src":"Day171_thumb.jpg","galleries_id":135837,"server_id":1,"link":"photo_6301817.html","width":130,"caption":"","height":87});
															thumbnails[6301818] = clik.newPhoto({"id":6301818,"src":"Day1121_thumb.jpg","galleries_id":135837,"server_id":1,"link":"photo_6301818.html","width":130,"caption":"","height":88});
															thumbnails[8318700] = clik.newPhoto({"id":8318700,"src":"Chime_and_Jess_thumb.jpg","galleries_id":135837,"server_id":1,"link":"photo_8318700.html","width":130,"caption":"Chime and Jess","height":151});
															thumbnails[8519709] = clik.newPhoto({"id":8519709,"src":"Chime1b_thumb.jpg","galleries_id":135837,"server_id":1,"link":"photo_8519709.html","width":130,"caption":"","height":248});
															thumbnails[8980121] = clik.newPhoto({"id":8980121,"src":"Chime4_thumb.jpg","galleries_id":135837,"server_id":1,"link":"photo_8980121.html","width":130,"caption":"Jan 2012","height":173});
															thumbnails[7910043] = clik.newPhoto({"id":7910043,"src":"Show_pictures_a_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_7910043.html","width":130,"caption":"Reserve inhand Champion","height":109});
															thumbnails[5771247] = clik.newPhoto({"id":5771247,"src":"20100407_13_web_DF228D84-1EC9-D45B-1C17D0179F68DE64_thumb.JPG","galleries_id":326504,"server_id":1,"link":"photo_5771247.html","width":130,"caption":"Jess arrives...........","height":195});
															thumbnails[5811763] = clik.newPhoto({"id":5811763,"src":"Foal_PS6_thumb.JPG","galleries_id":326504,"server_id":1,"link":"photo_5811763.html","width":130,"caption":"Glen Bruar Genesis","height":130});
															thumbnails[7521509] = clik.newPhoto({"id":7521509,"src":"Jess_2_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_7521509.html","width":130,"caption":"Curly mane like her Dad","height":173});
															thumbnails[7933161] = clik.newPhoto({"id":7933161,"src":"SANY1659_Small_thumb.JPG","galleries_id":326504,"server_id":1,"link":"photo_7933161.html","width":130,"caption":"Strathisla RC Show ","height":98});
															thumbnails[7934131] = clik.newPhoto({"id":7934131,"src":"Jessie_a_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_7934131.html","width":130,"caption":"Pretty girl","height":127});
															thumbnails[8177808] = clik.newPhoto({"id":8177808,"src":"DSCN5486_thumb.JPG","galleries_id":326504,"server_id":1,"link":"photo_8177808.html","width":130,"caption":"July 21","height":98});
															thumbnails[8290460] = clik.newPhoto({"id":8290460,"src":"JessieJ_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_8290460.html","width":130,"caption":"GB Genesis","height":76});
															thumbnails[8290462] = clik.newPhoto({"id":8290462,"src":"JessieJ2_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_8290462.html","width":130,"caption":"GB Genesis","height":77});
															thumbnails[8290463] = clik.newPhoto({"id":8290463,"src":"JessieJ3_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_8290463.html","width":130,"caption":"GB Genesis","height":206});
															thumbnails[8318701] = clik.newPhoto({"id":8318701,"src":"Jess_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_8318701.html","width":130,"caption":"18 August 2011","height":157});
															thumbnails[8519725] = clik.newPhoto({"id":8519725,"src":"Jessie_1b_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_8519725.html","width":130,"caption":"Sept 2011","height":109});
															thumbnails[8519778] = clik.newPhoto({"id":8519778,"src":"Jessie_1c_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_8519778.html","width":130,"caption":"Spet 2011","height":95});
															thumbnails[8519790] = clik.newPhoto({"id":8519790,"src":"Jessie_1d_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_8519790.html","width":130,"caption":"Head shot","height":194});
															thumbnails[8942233] = clik.newPhoto({"id":8942233,"src":"28112011061_thumb_3C93A584-1EC9-DFB6-099EE9B66611DA74.jpg","galleries_id":326504,"server_id":1,"link":"photo_8942233.html","width":130,"caption":"December 2011","height":73});
															thumbnails[8942255] = clik.newPhoto({"id":8942255,"src":"28112011066_thumb.jpg","galleries_id":326504,"server_id":1,"link":"photo_8942255.html","width":130,"caption":"","height":73});
															thumbnails[1358299] = clik.newPhoto({"id":1358299,"src":"Glenbruar Misty Morn 1991_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_1358299.html","width":130,"caption":"Glen Bruar Misty Morn","height":195});
															thumbnails[675493] = clik.newPhoto({"id":675493,"src":"0011_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_675493.html","width":130,"caption":"Glen Bruar April","height":130});
															thumbnails[675494] = clik.newPhoto({"id":675494,"src":"002_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_675494.html","width":130,"caption":"Glen Bruar Dunvegan","height":101});
															thumbnails[675601] = clik.newPhoto({"id":675601,"src":"011_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_675601.html","width":130,"caption":"Glen Bruar III in paniers","height":130});
															thumbnails[675605] = clik.newPhoto({"id":675605,"src":"013_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_675605.html","width":130,"caption":"Glen Bruar III","height":87});
															thumbnails[675606] = clik.newPhoto({"id":675606,"src":"014_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_675606.html","width":130,"caption":"Glen Bruar Findlay otherwise known as 'Budgie'","height":87});
															thumbnails[675618] = clik.newPhoto({"id":675618,"src":"(24)_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_675618.html","width":130,"caption":"Glen Bruar Beinn Losgarnach","height":87});
															thumbnails[834613] = clik.newPhoto({"id":834613,"src":"glenbruarpic_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_834613.html","width":130,"caption":"Glen Bruar Fern","height":100});
															thumbnails[1009418] = clik.newPhoto({"id":1009418,"src":"Web 0017_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_1009418.html","width":130,"caption":"Glen Bruar Summer","height":195});
															thumbnails[3031868] = clik.newPhoto({"id":3031868,"src":"DSC_0088 web_thumb.jpg","galleries_id":178261,"server_id":1,"link":"photo_3031868.html","width":130,"caption":"Lucy and Daisy - Reserve Champion Young Handler November 2008","height":195});
															thumbnails[3031877] = clik.newPhoto({"id":3031877,"src":"DSC_0063 web_thumb.jpg","galleries_id":178261,"server_id":1,"link":"photo_3031877.html","width":130,"caption":"Caitlin and a naughty Daisy","height":87});
															thumbnails[3031891] = clik.newPhoto({"id":3031891,"src":"DSC_0090 web_thumb.jpg","galleries_id":178261,"server_id":1,"link":"photo_3031891.html","width":130,"caption":"Chuffed wee girl!!!!","height":87});
															thumbnails[3144890] = clik.newPhoto({"id":3144890,"src":"291108 (55) web_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_3144890.html","width":130,"caption":"Glen Bruar Summer Thyme","height":195});
															thumbnails[3264216] = clik.newPhoto({"id":3264216,"src":"DSC_0126 web_thumb.jpg","galleries_id":178261,"server_id":1,"link":"photo_3264216.html","width":130,"caption":"Dexter wins his big foal class","height":87});
															thumbnails[4584743] = clik.newPhoto({"id":4584743,"src":"02290825-Horses-1_thumb.JPG","galleries_id":178261,"server_id":1,"link":"photo_4584743.html","width":130,"caption":"Daisy - August 2009","height":87});
															thumbnails[4585201] = clik.newPhoto({"id":4585201,"src":"HiPo063_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_4585201.html","width":130,"caption":"Glen Bruar Dunvegan doing well down south","height":87});
															thumbnails[4693907] = clik.newPhoto({"id":4693907,"src":"Northern_Working_Horse_Society_2009_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_4693907.html","width":130,"caption":"Champion and Reserve Overall - Northern Working Horse Show, Brodie Castle - Ella of Craignetherty","height":176});
															thumbnails[7760349] = clik.newPhoto({"id":7760349,"src":"29042011656_thumb.jpg","galleries_id":178261,"server_id":1,"link":"photo_7760349.html","width":130,"caption":"Daisy 2011","height":87});
															thumbnails[7851390] = clik.newPhoto({"id":7851390,"src":"Ellie_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_7851390.html","width":130,"caption":"Glen Bruar Fairy Tale","height":103});
															thumbnails[8322915] = clik.newPhoto({"id":8322915,"src":"Pride_3_thumb.jpg","galleries_id":51436,"server_id":1,"link":"photo_8322915.html","width":130,"caption":"Achnacone Bruar's Pride","height":146});
															thumbnails[675495] = clik.newPhoto({"id":675495,"src":"003_thumb.jpg","galleries_id":51439,"server_id":1,"link":"photo_675495.html","width":130,"caption":"Meggernie Maydew","height":87});
															thumbnails[675499] = clik.newPhoto({"id":675499,"src":"007_thumb.jpg","galleries_id":51439,"server_id":1,"link":"photo_675499.html","width":130,"caption":"Meggernie Maydew","height":195});
															thumbnails[675603] = clik.newPhoto({"id":675603,"src":"012_thumb.jpg","galleries_id":51439,"server_id":1,"link":"photo_675603.html","width":130,"caption":"Lorna of Invervack","height":120});
															thumbnails[675609] = clik.newPhoto({"id":675609,"src":"016_thumb.jpg","galleries_id":51439,"server_id":1,"link":"photo_675609.html","width":130,"caption":"Meggernie Maydew","height":87});
															thumbnails[685221] = clik.newPhoto({"id":685221,"src":"070105 (5)_thumb.JPG","galleries_id":51439,"server_id":1,"link":"photo_685221.html","width":130,"caption":"Rose of Invervack","height":87});
															thumbnails[893228] = clik.newPhoto({"id":893228,"src":"RHS WIN_thumb.jpg","galleries_id":51439,"server_id":1,"link":"photo_893228.html","width":130,"caption":"Meggernie Maydew ","height":87});
															thumbnails[1493782] = clik.newPhoto({"id":1493782,"src":"RHS 1992_thumb.jpg","galleries_id":51439,"server_id":1,"link":"photo_1493782.html","width":130,"caption":"Meggernie Maydew ","height":195});
															thumbnails[2101361] = clik.newPhoto({"id":2101361,"src":"Bridle 1_thumb.jpg","galleries_id":331285,"server_id":1,"link":"photo_2101361.html","width":130,"caption":"Bridles - handmade by excellent saddler","height":195});
															thumbnails[2101366] = clik.newPhoto({"id":2101366,"src":"Bridle 2_thumb.jpg","galleries_id":331285,"server_id":1,"link":"photo_2101366.html","width":130,"caption":"Bridles - the older more traditional style.","height":195});
															thumbnails[7692733] = clik.newPhoto({"id":7692733,"src":"Chime_pic_Watermark_thumb.jpg","galleries_id":331285,"server_id":1,"link":"photo_7692733.html","width":130,"caption":"Picture of Chime","height":182});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[331285] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"For sale\/Hire","link":"section397023.html","maxRecords":0.0,"photoIDs":[2101361.0,2101366.0,7692733.0],"skipIndex":0,"section_code":"section397023","featured_images":"7692733,2101366,2101361","id":331285,"singleSection":true});				  						galleries[320887] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"News","link":"section384823.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section384823","featured_images":"","id":320887,"singleSection":true});				  						galleries[320896] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Show results","link":"section384834.html","maxRecords":0.0,"photoIDs":[6301823.0,6461926.0,8290464.0,8290468.0],"skipIndex":0,"section_code":"section384834","featured_images":"8290468,8290464,6461926,6301823","id":320896,"singleSection":true});				  						galleries[135836] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Thea of Sherrifmuir","link":"section501732.html","maxRecords":0.0,"photoIDs":[7521560.0,7746403.0,8072415.0,8072417.0,8318664.0],"skipIndex":0,"section_code":"section501732","featured_images":"8318664,8072417,8072415,7746403,7521560","id":135836,"singleSection":true});				  						galleries[326504] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Glen Bruar Genesis","link":"section501734.html","maxRecords":0.0,"photoIDs":[7910043.0,5771247.0,5811763.0,7521509.0,7933161.0,7934131.0,8177808.0,8290460.0,8290462.0,8290463.0,8318701.0,8519725.0,8519778.0,8519790.0,8942233.0,8942255.0],"skipIndex":0,"section_code":"section501734","featured_images":"8942255,8942233,8519790,8519778,8519725,8318701,8290463,8290462,8290460,8177808","id":326504,"singleSection":true});				  						galleries[135837] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lochlands Silver Chime","link":"section501733.html","maxRecords":0.0,"photoIDs":[2204264.0,2612167.0,4423971.0,4693960.0,6301817.0,6301818.0,8318700.0,8519709.0,8980121.0],"skipIndex":0,"section_code":"section501733","featured_images":2612167.0,"id":135837,"singleSection":true});				  						galleries[51436] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Ponies owned and bred","link":"section501736.html","maxRecords":0.0,"photoIDs":[1358299.0,675493.0,675494.0,675601.0,675605.0,675606.0,675618.0,834613.0,1009418.0,3144890.0,4585201.0,4693907.0,7851390.0,8322915.0],"skipIndex":0,"section_code":"section501736","featured_images":"8322915,7851390,4693907,4585201,3144890,1358299,1009418,834613,675618,675606","id":51436,"singleSection":true});				  						galleries[51439] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Golden Oldies","link":"section501737.html","maxRecords":0.0,"photoIDs":[675495.0,675499.0,675603.0,675609.0,685221.0,893228.0,1493782.0],"skipIndex":0,"section_code":"section501737","featured_images":"1493782,893228,685221,675609,675603,675499,675495","id":51439,"singleSection":true});				  						galleries[178261] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Hobbits","link":"section501735.html","maxRecords":0.0,"photoIDs":[3031868.0,3031877.0,3031891.0,3264216.0,4584743.0,7760349.0],"skipIndex":0,"section_code":"section501735","featured_images":"7760349,4584743,3264216,3031891,3031877,3031868","id":178261,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8519790,8519778,8290462,8290460,8072409,7933161,7910043,7851390,7746403,7717987,6552186,6301823,5811763,4693960,3719110,2204264,893228';
imageSets[2] = '2612167';
imageSets[3] = '8290462,8290460,4693960,4693907';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/glenbruar/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/glenbruar/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 += 'section384823.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 && 'section384823' != '') {
					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 = 'Glenbruar Highland Ponies: ' + 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="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="GLENBRUAR">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

