window.thumbnails = {};
															thumbnails[852678] = clik.newPhoto({"id":852678,"src":"PICT0599_thumb.JPG","galleries_id":63446,"server_id":18,"link":"photo_852678.html","width":130,"caption":"The view to the Cairngorms from our private back garden","height":98});
															thumbnails[852682] = clik.newPhoto({"id":852682,"src":"PICT0600_thumb.JPG","galleries_id":63446,"server_id":18,"link":"photo_852682.html","width":130,"caption":"Back Door to our garden perfect for the kids to play","height":98});
															thumbnails[852691] = clik.newPhoto({"id":852691,"src":"PICT0601_thumb.JPG","galleries_id":65735,"server_id":18,"link":"photo_852691.html","width":130,"caption":"Luxury Kitchen and Dining Area","height":98});
															thumbnails[852700] = clik.newPhoto({"id":852700,"src":"PICT0603_thumb.JPG","galleries_id":65735,"server_id":18,"link":"photo_852700.html","width":130,"caption":"Large Dining Area - Table extends for 6 people","height":98});
															thumbnails[852703] = clik.newPhoto({"id":852703,"src":"PICT0602_thumb.JPG","galleries_id":65735,"server_id":18,"link":"photo_852703.html","width":130,"caption":"Kitchen in a lovely Sunny day","height":98});
															thumbnails[852704] = clik.newPhoto({"id":852704,"src":"PICT0596_thumb.JPG","galleries_id":65741,"server_id":18,"link":"photo_852704.html","width":130,"caption":"Smart and attractive bathroom<br>\r\n(there's another smaller one downstairs)","height":98});
															thumbnails[852708] = clik.newPhoto({"id":852708,"src":"PICT0597_thumb.JPG","galleries_id":65741,"server_id":18,"link":"photo_852708.html","width":130,"caption":"Brush your teeth looking out at the Cairngorms","height":98});
															thumbnails[852715] = clik.newPhoto({"id":852715,"src":"PICT0587_thumb.JPG","galleries_id":65746,"server_id":18,"link":"photo_852715.html","width":130,"caption":"Nice Room with Dressing Table, Mirrored Wardrobe","height":98});
															thumbnails[855592] = clik.newPhoto({"id":855592,"src":"Aviemore2004_12_thumb.jpeg","galleries_id":65974,"server_id":18,"link":"photo_855592.html","width":130,"caption":"Walking in Aviemore","height":97});
															thumbnails[857753] = clik.newPhoto({"id":857753,"src":"P1040544copy_thumb.JPG","galleries_id":66079,"server_id":18,"link":"photo_857753.html","width":130,"caption":"Good sized Lounge","height":98});
															thumbnails[857765] = clik.newPhoto({"id":857765,"src":"PICT0608_thumb.JPG","galleries_id":66079,"server_id":18,"link":"photo_857765.html","width":130,"caption":"Lounge to Hall","height":98});
															thumbnails[857767] = clik.newPhoto({"id":857767,"src":"PICT0607_thumb.JPG","galleries_id":66079,"server_id":18,"link":"photo_857767.html","width":130,"caption":"Lounge to Kitchen","height":98});
															thumbnails[857769] = clik.newPhoto({"id":857769,"src":"PICT0605_thumb.JPG","galleries_id":66079,"server_id":18,"link":"photo_857769.html","width":130,"caption":"Lounge and to the Front","height":98});
															thumbnails[858061] = clik.newPhoto({"id":858061,"src":"Photosat27406 031_thumb.jpg","galleries_id":65974,"server_id":18,"link":"photo_858061.html","width":130,"caption":"Loch an Eilan in January","height":98});
															thumbnails[858063] = clik.newPhoto({"id":858063,"src":"Photosat27406 005_thumb.jpg","galleries_id":63446,"server_id":18,"link":"photo_858063.html","width":130,"caption":"The Sunbury villa from the front","height":98});
															thumbnails[858195] = clik.newPhoto({"id":858195,"src":"Photosat27406 008_thumb.jpg","galleries_id":63446,"server_id":18,"link":"photo_858195.html","width":130,"caption":"The Garden at the side of the house","height":98});
															thumbnails[858198] = clik.newPhoto({"id":858198,"src":"Photosat27406 009_thumb.jpg","galleries_id":63446,"server_id":18,"link":"photo_858198.html","width":130,"caption":"Sunbury with its own driveway","height":98});
															thumbnails[858202] = clik.newPhoto({"id":858202,"src":"Photosat27406 023_thumb.jpg","galleries_id":65974,"server_id":18,"link":"photo_858202.html","width":130,"caption":"Chucking 'stanes' on the ice....perfect in January","height":98});
															thumbnails[858204] = clik.newPhoto({"id":858204,"src":"Photosat27406 0201_thumb.jpg","galleries_id":65974,"server_id":18,"link":"photo_858204.html","width":130,"caption":"What will we get up to now? Loch an Eilan January","height":98});
															thumbnails[858207] = clik.newPhoto({"id":858207,"src":"Photosat27406 025_thumb.jpg","galleries_id":65974,"server_id":18,"link":"photo_858207.html","width":130,"caption":"Lets see if we fall through the ice?","height":98});
															thumbnails[859377] = clik.newPhoto({"id":859377,"src":"P1040543copy_thumb.JPG","galleries_id":65734,"server_id":18,"link":"photo_859377.html","width":130,"caption":"Lounge with Flat Screen 32\" LG TV","height":98});
															thumbnails[859403] = clik.newPhoto({"id":859403,"src":"PICT06081_thumb.JPG","galleries_id":65734,"server_id":18,"link":"photo_859403.html","width":130,"caption":"Lounge to Hall","height":98});
															thumbnails[859406] = clik.newPhoto({"id":859406,"src":"PICT06071_thumb.JPG","galleries_id":65734,"server_id":18,"link":"photo_859406.html","width":130,"caption":"Lounge to Kitchen with a view of the Washing Machine - How Nice!","height":98});
															thumbnails[859443] = clik.newPhoto({"id":859443,"src":"PICT0606_thumb.JPG","galleries_id":65734,"server_id":18,"link":"photo_859443.html","width":130,"caption":"Fire and Fireplace is cosy to come home to in the winter","height":98});
															thumbnails[859450] = clik.newPhoto({"id":859450,"src":"PICT06011_thumb.JPG","galleries_id":65735,"server_id":18,"link":"photo_859450.html","width":130,"caption":"Bright and Modern Kitchen","height":98});
															thumbnails[859473] = clik.newPhoto({"id":859473,"src":"PICT0593_thumb.JPG","galleries_id":65748,"server_id":18,"link":"photo_859473.html","width":130,"caption":"Two single beds in this room - nice views to the Craigellachie Hills","height":98});
															thumbnails[859479] = clik.newPhoto({"id":859479,"src":"PICT0594_thumb.JPG","galleries_id":65748,"server_id":18,"link":"photo_859479.html","width":130,"caption":"Plenty of cupboard space","height":98});
															thumbnails[859507] = clik.newPhoto({"id":859507,"src":"PICT0591_thumb.JPG","galleries_id":65748,"server_id":18,"link":"photo_859507.html","width":130,"caption":"Two new and comfortable single beds in this room ","height":98});
															thumbnails[859516] = clik.newPhoto({"id":859516,"src":"PICT0586_thumb.JPG","galleries_id":65746,"server_id":18,"link":"photo_859516.html","width":130,"caption":"Plenty of cupboard space here and a view to the Cairngorm - very peaceful","height":98});
															thumbnails[859520] = clik.newPhoto({"id":859520,"src":"PICT05871_thumb.JPG","galleries_id":65746,"server_id":18,"link":"photo_859520.html","width":130,"caption":"Good sized room","height":98});
															thumbnails[859523] = clik.newPhoto({"id":859523,"src":"PICT0590_thumb.JPG","galleries_id":65747,"server_id":18,"link":"photo_859523.html","width":130,"caption":"Comfortable and peaceful room","height":98});
															thumbnails[859548] = clik.newPhoto({"id":859548,"src":"PICT0592_thumb.JPG","galleries_id":65747,"server_id":18,"link":"photo_859548.html","width":130,"caption":"Overlooking Craigellachie","height":98});
															thumbnails[859555] = clik.newPhoto({"id":859555,"src":"PICT05911_thumb.JPG","galleries_id":65747,"server_id":18,"link":"photo_859555.html","width":130,"caption":"Another look at the same room","height":98});
															thumbnails[859558] = clik.newPhoto({"id":859558,"src":"PICT05861_thumb.JPG","galleries_id":65746,"server_id":18,"link":"photo_859558.html","width":130,"caption":"Plenty of space ","height":98});
															thumbnails[861286] = clik.newPhoto({"id":861286,"src":"Photosat27406 326_thumb.jpg","galleries_id":65974,"server_id":18,"link":"photo_861286.html","width":130,"caption":"A good ski day in Easter","height":98});
															thumbnails[861288] = clik.newPhoto({"id":861288,"src":"Photosat27406 315_thumb.jpg","galleries_id":65974,"server_id":18,"link":"photo_861288.html","width":130,"caption":"Quality Skiing at the Ptarmigan","height":98});
															thumbnails[910991] = clik.newPhoto({"id":910991,"src":"P1020792_thumb.JPG","galleries_id":63446,"server_id":18,"link":"photo_910991.html","width":130,"caption":"View to the Cairngorms","height":98});
															thumbnails[910992] = clik.newPhoto({"id":910992,"src":"P1020795_thumb.JPG","galleries_id":63446,"server_id":18,"link":"photo_910992.html","width":130,"caption":"House at the back","height":98});
															thumbnails[910993] = clik.newPhoto({"id":910993,"src":"P1020777_thumb.JPG","galleries_id":65974,"server_id":18,"link":"photo_910993.html","width":130,"caption":"Day out at Millport -( not near Aviemore)","height":98});
															thumbnails[910994] = clik.newPhoto({"id":910994,"src":"P1020801_thumb.JPG","galleries_id":63446,"server_id":18,"link":"photo_910994.html","width":130,"caption":"House at the front","height":98});
															thumbnails[910995] = clik.newPhoto({"id":910995,"src":"P1020798_thumb.JPG","galleries_id":65974,"server_id":18,"link":"photo_910995.html","width":130,"caption":"Cairngorms at the back with lots of snow while its 20c","height":98});
															thumbnails[1765550] = clik.newPhoto({"id":1765550,"src":"Aviemore 2008 001_thumb.jpg","galleries_id":118438,"server_id":18,"link":"photo_1765550.html","width":130,"caption":"Loch Morlich on Jan 2 2008","height":98});
															thumbnails[1778585] = clik.newPhoto({"id":1778585,"src":"Aviemore 2008 007_thumb.jpg","galleries_id":118438,"server_id":18,"link":"photo_1778585.html","width":130,"caption":"Loch Morlich again","height":98});
															thumbnails[1778597] = clik.newPhoto({"id":1778597,"src":"Aviemore 2008 008_thumb.jpg","galleries_id":118438,"server_id":18,"link":"photo_1778597.html","width":130,"caption":"Loch side around 1pm Jan 2008","height":98});
															thumbnails[1778601] = clik.newPhoto({"id":1778601,"src":"Aviemore 2008 014_thumb.jpg","galleries_id":118438,"server_id":18,"link":"photo_1778601.html","width":130,"caption":"Nice picture with the Sun light","height":98});
															thumbnails[1778603] = clik.newPhoto({"id":1778603,"src":"Aviemore 2008 021_thumb.jpg","galleries_id":118438,"server_id":18,"link":"photo_1778603.html","width":130,"caption":"My three lovely girls.......Half way round Loch Morlich..\"Will we ever get there?\"","height":98});
															thumbnails[1778604] = clik.newPhoto({"id":1778604,"src":"Aviemore 2008 024_thumb.jpg","galleries_id":118438,"server_id":18,"link":"photo_1778604.html","width":130,"caption":"Sun Trees and Water","height":98});
															thumbnails[1778607] = clik.newPhoto({"id":1778607,"src":"Aviemore 2008 037_thumb.jpg","galleries_id":118438,"server_id":18,"link":"photo_1778607.html","width":130,"caption":"Pleasant Day at Loch Morlich","height":98});
															thumbnails[1778623] = clik.newPhoto({"id":1778623,"src":"Aviemore 2008 0371_thumb.jpg","galleries_id":118438,"server_id":18,"link":"photo_1778623.html","width":130,"caption":"Trees Water and Sun","height":98});
															thumbnails[1793112] = clik.newPhoto({"id":1793112,"src":"skiboy_thumb.jpg","galleries_id":118438,"server_id":18,"link":"photo_1793112.html","width":130,"caption":"Superb Sking this year - I'm up there next week....","height":64});
															thumbnails[1913617] = clik.newPhoto({"id":1913617,"src":"skiing2008 033_thumb.jpg","galleries_id":124959,"server_id":18,"link":"photo_1913617.html","width":130,"caption":"February Ski week ","height":98});
															thumbnails[2853604] = clik.newPhoto({"id":2853604,"src":"cas_thumb.jpg","galleries_id":124959,"server_id":18,"link":"photo_2853604.html","width":130,"caption":"Cas ski day Easter 2008 - superb","height":98});
															thumbnails[2853664] = clik.newPhoto({"id":2853664,"src":"skiing2008 025_thumb.jpg","galleries_id":124959,"server_id":18,"link":"photo_2853664.html","width":130,"caption":"Another run up to middle station","height":98});
															thumbnails[2853671] = clik.newPhoto({"id":2853671,"src":"skiing2008 023_thumb.jpg","galleries_id":124959,"server_id":18,"link":"photo_2853671.html","width":130,"caption":"I'm off to the top!!!","height":98});
															thumbnails[2853827] = clik.newPhoto({"id":2853827,"src":"skiing2008 028_thumb.jpg","galleries_id":124959,"server_id":18,"link":"photo_2853827.html","width":130,"caption":"Ski tow to the top above Ptarmigan..quiet day","height":98});
															thumbnails[2853874] = clik.newPhoto({"id":2853874,"src":"skiing2008 032_thumb.JPG","galleries_id":124959,"server_id":18,"link":"photo_2853874.html","width":130,"caption":"I've skied all day- and now looking forward to that Hot Chocolate!!!","height":98});
															thumbnails[2853887] = clik.newPhoto({"id":2853887,"src":"skiing2008 015_thumb.jpg","galleries_id":124959,"server_id":18,"link":"photo_2853887.html","width":130,"caption":"Another run - I'm glad i've got my sunglasses","height":98});
															thumbnails[2853908] = clik.newPhoto({"id":2853908,"src":"skiing2008 030_thumb.jpg","galleries_id":124959,"server_id":18,"link":"photo_2853908.html","width":130,"caption":"Look no poles.....","height":98});
															thumbnails[5551732] = clik.newPhoto({"id":5551732,"src":"P1040550_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551732.html","width":130,"caption":"Ski sunny day - brilliant","height":98});
															thumbnails[5551737] = clik.newPhoto({"id":5551737,"src":"P1040551_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551737.html","width":130,"caption":"Take in some Rays","height":98});
															thumbnails[5551740] = clik.newPhoto({"id":5551740,"src":"P1040552_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551740.html","width":130,"caption":"My new jacket","height":98});
															thumbnails[5551805] = clik.newPhoto({"id":5551805,"src":"P1040555_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551805.html","width":130,"caption":"","height":98});
															thumbnails[5551806] = clik.newPhoto({"id":5551806,"src":"P1040557copy_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551806.html","width":130,"caption":"","height":98});
															thumbnails[5551807] = clik.newPhoto({"id":5551807,"src":"P1040558copy_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551807.html","width":130,"caption":"","height":98});
															thumbnails[5551808] = clik.newPhoto({"id":5551808,"src":"P1040559copy_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551808.html","width":130,"caption":"","height":98});
															thumbnails[5551809] = clik.newPhoto({"id":5551809,"src":"P1040560copy_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551809.html","width":130,"caption":"","height":98});
															thumbnails[5551810] = clik.newPhoto({"id":5551810,"src":"P1040561copy_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551810.html","width":130,"caption":"","height":98});
															thumbnails[5551811] = clik.newPhoto({"id":5551811,"src":"P1040562copy_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551811.html","width":130,"caption":"","height":98});
															thumbnails[5551812] = clik.newPhoto({"id":5551812,"src":"P1040564copy_thumb.JPG","galleries_id":314612,"server_id":18,"link":"photo_5551812.html","width":130,"caption":"","height":98});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[118438] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"2008 pics","link":"gallery_118438.html","maxRecords":0.0,"photoIDs":[1765550.0,1778585.0,1778597.0,1778601.0,1778603.0,1778604.0,1778607.0,1778623.0,1793112.0],"skipIndex":0,"section_code":"gallery","featured_images":"1793112,1778623,1778607,1778604,1778603,1778601,1778597,1778585,1765550","id":118438,"singleSection":false});				  						galleries[314612] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"2010 Feb","link":"gallery_314612.html","maxRecords":0.0,"photoIDs":[5551732.0,5551737.0,5551740.0,5551805.0,5551806.0,5551807.0,5551808.0,5551809.0,5551810.0,5551811.0,5551812.0],"skipIndex":0,"section_code":"gallery","featured_images":"5551812,5551811,5551810,5551809,5551808,5551807,5551806,5551805,5551740,5551737","id":314612,"singleSection":false});				  						galleries[65974] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Aviemore","link":"gallery_65974.html","maxRecords":0.0,"photoIDs":[855592.0,858061.0,858202.0,858204.0,858207.0,861286.0,861288.0,910993.0,910995.0],"skipIndex":0,"section_code":"gallery","featured_images":"910995,910993,861288,861286,858207,858204,858202,858061,855592","id":65974,"singleSection":false});				  						galleries[65741] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Family Bathroom","link":"gallery_65741.html","maxRecords":0.0,"photoIDs":[852704.0,852708.0],"skipIndex":0,"section_code":"gallery","featured_images":852704.0,"id":65741,"singleSection":false});				  						galleries[65734] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Inside Sunbury","link":"gallery_65734.html","maxRecords":0.0,"photoIDs":[859377.0,859403.0,859406.0,859443.0],"skipIndex":0,"section_code":"gallery","featured_images":"859443,859406,859403,859377","id":65734,"singleSection":false});				  						galleries[66079] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lounge","link":"gallery_66079.html","maxRecords":0.0,"photoIDs":[857753.0,857765.0,857767.0,857769.0],"skipIndex":0,"section_code":"gallery","featured_images":"857769,857767,857765,857753","id":66079,"singleSection":false});				  						galleries[65746] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Master Bedroom","link":"gallery_65746.html","maxRecords":0.0,"photoIDs":[852715.0,859516.0,859520.0,859558.0],"skipIndex":0,"section_code":"gallery","featured_images":"859558,859520,859516,852715","id":65746,"singleSection":false});				  						galleries[65747] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Second Bedroom","link":"gallery_65747.html","maxRecords":0.0,"photoIDs":[859523.0,859548.0,859555.0],"skipIndex":0,"section_code":"gallery","featured_images":"859555,859548,859523","id":65747,"singleSection":false});				  						galleries[124959] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Skiing 2008","link":"gallery_124959.html","maxRecords":0.0,"photoIDs":[1913617.0,2853604.0,2853664.0,2853671.0,2853827.0,2853874.0,2853887.0,2853908.0],"skipIndex":0,"section_code":"gallery","featured_images":"2853908,2853887,2853874,2853827,2853671,2853664,2853604,1913617","id":124959,"singleSection":false});				  						galleries[65735] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sunbury Luxury Kitchen and Dining","link":"gallery_65735.html","maxRecords":0.0,"photoIDs":[852691.0,852700.0,852703.0,859450.0],"skipIndex":0,"section_code":"gallery","featured_images":"859450,852703,852700,852691","id":65735,"singleSection":false});				  						galleries[65748] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Third Bedroom  ","link":"gallery_65748.html","maxRecords":0.0,"photoIDs":[859473.0,859479.0,859507.0],"skipIndex":0,"section_code":"gallery","featured_images":"859507,859479,859473","id":65748,"singleSection":false});				  						galleries[63446] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sunbury","link":"gallery_63446.html","maxRecords":0.0,"photoIDs":[852678.0,852682.0,858063.0,858195.0,858198.0,910991.0,910992.0,910994.0],"skipIndex":0,"section_code":"gallery","featured_images":910991.0,"id":63446,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1765550,910995,910994,910992,861286,859548,859523,859520,859516,859507,859479,859473,859450,859443,859406,859403,859377,858207,858204,858202,858198,858195,858061,857769,852715,852708,852703,852700,852691,852682,852678';
imageSets[2] = '910991,852704';
imageSets[3] = '5551812,5551811,5551810,5551809,5551808,5551807,5551806,5551805,5551740,5551737,5551732,2853908,2853887,2853874,2853827,2853671,2853664,2853604,1913617,1793112,1778623,1778607,1778604,1778603,1778601,1778597,1778585,1765550,910995,910994,910993,910992,910991,861288,861286,859558,859555,859548,859523,859520,859516,859507,859479,859473,859450,859443,859406,859403,859377,858207';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/mccormickaviemore/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/mccormickaviemore/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 = 'Aviemore Holidays: ' + 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;
	}
}

			

