window.thumbnails = {};
															thumbnails[8789424] = clik.newPhoto({"id":8789424,"src":"Clydeside-DSC_0601-w-copy_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Glasgow Clydeside","height":86});
															thumbnails[8398196] = clik.newPhoto({"id":8398196,"src":"Edinburgh_Fringe_DSC_0227__copy_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_8398196.html","width":130,"caption":"Portrait of girl","height":196});
															thumbnails[8398216] = clik.newPhoto({"id":8398216,"src":"Edinburgh_Fringe_DSC_0213__copy_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_8398216.html","width":130,"caption":"Street Theatre","height":109});
															thumbnails[8398225] = clik.newPhoto({"id":8398225,"src":"Edinburgh_Festival_DSC_0221_copy_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_8398225.html","width":130,"caption":"Street theatre","height":86});
															thumbnails[7845203] = clik.newPhoto({"id":7845203,"src":"Bluebells_DSC_0005_copy_thumb.jpg","galleries_id":147635,"server_id":5,"link":"photo_7845203.html","width":130,"caption":"Bluebells","height":86});
															thumbnails[6595672] = clik.newPhoto({"id":6595672,"src":"Edinburgh-Festival-IMG_7649_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_6595672.html","width":130,"caption":"Edinburgh Festival","height":195});
															thumbnails[6595731] = clik.newPhoto({"id":6595731,"src":"Edinburgh-Festival-IMG_7464-_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_6595731.html","width":130,"caption":"Comic","height":167});
															thumbnails[6595743] = clik.newPhoto({"id":6595743,"src":"Edinburgh-Festival-IMG_7456_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_6595743.html","width":130,"caption":"Two girls asleep","height":107});
															thumbnails[6583043] = clik.newPhoto({"id":6583043,"src":"Edinburgh-Festival-IMG_7466_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_6583043.html","width":130,"caption":"Edinburgh Festival 2010","height":178});
															thumbnails[6595778] = clik.newPhoto({"id":6595778,"src":"Edinburgh-Festival-IMG_7637_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_6595778.html","width":130,"caption":"Miss Whiplash","height":195});
															thumbnails[4622997] = clik.newPhoto({"id":4622997,"src":"Edinburgh-Festival-5190_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4622997.html","width":130,"caption":"Portrait of girl","height":178});
															thumbnails[4623209] = clik.newPhoto({"id":4623209,"src":"Edinburgh-Festival-5196_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623209.html","width":130,"caption":"Street Theatre","height":185});
															thumbnails[4623235] = clik.newPhoto({"id":4623235,"src":"Edinburgh-Festival-5220_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623235.html","width":130,"caption":"Edinburgh Festival","height":179});
															thumbnails[4623249] = clik.newPhoto({"id":4623249,"src":"Edinburgh-Festival-5223_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623249.html","width":130,"caption":"Girl Portrait","height":195});
															thumbnails[4623258] = clik.newPhoto({"id":4623258,"src":"Edinburgh-Festival-5231_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623258.html","width":130,"caption":"Girl Portrait","height":194});
															thumbnails[4623307] = clik.newPhoto({"id":4623307,"src":"Edinburgh-Festival_5108_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623307.html","width":130,"caption":"Girl with mask","height":184});
															thumbnails[4623319] = clik.newPhoto({"id":4623319,"src":"Edinburgh-Festival_5111_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623319.html","width":130,"caption":"Street theatre","height":195});
															thumbnails[4623323] = clik.newPhoto({"id":4623323,"src":"Edinburgh-Festival_5119_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623323.html","width":130,"caption":"Dance","height":104});
															thumbnails[4623326] = clik.newPhoto({"id":4623326,"src":"Edinburgh-Festival_5120_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623326.html","width":130,"caption":"Couple dancing","height":176});
															thumbnails[4623339] = clik.newPhoto({"id":4623339,"src":"Edinburgh-Festival_5138_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623339.html","width":130,"caption":"Girls advertising their show","height":87});
															thumbnails[4623347] = clik.newPhoto({"id":4623347,"src":"Edinburgh-Festival_5187_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623347.html","width":130,"caption":"Portrait Dracula","height":178});
															thumbnails[4623351] = clik.newPhoto({"id":4623351,"src":"Edinburgh-Festival_5205_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623351.html","width":130,"caption":"Girl with puppet","height":87});
															thumbnails[4623552] = clik.newPhoto({"id":4623552,"src":"Edinburgh-Festival-50721_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623552.html","width":130,"caption":"Street theatre","height":195});
															thumbnails[4623562] = clik.newPhoto({"id":4623562,"src":"Edinburgh-Festival-_5084_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623562.html","width":130,"caption":"Artiste on mobile","height":180});
															thumbnails[4623582] = clik.newPhoto({"id":4623582,"src":"Edinburgh-Festival_51891_thumb.jpg","galleries_id":267127,"server_id":5,"link":"photo_4623582.html","width":130,"caption":"Group with masks","height":87});
															thumbnails[4634229] = clik.newPhoto({"id":4634229,"src":"Corran-Ferry-_4883_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_4634229.html","width":130,"caption":"Corran Ferry","height":87});
															thumbnails[2237240] = clik.newPhoto({"id":2237240,"src":"Argyll-Black-Rock-Cottage-_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2237240.html","width":130,"caption":"Black Rock cottage Argyll","height":131});
															thumbnails[2359915] = clik.newPhoto({"id":2359915,"src":"Corpach-w-copy1_thumb.jpg","galleries_id":153070,"server_id":5,"link":"photo_2359915.html","width":130,"caption":"Corpach","height":48});
															thumbnails[2359917] = clik.newPhoto({"id":2359917,"src":"Lochan-nah-Achlaise-1w-copy_thumb.jpg","galleries_id":153070,"server_id":5,"link":"photo_2359917.html","width":130,"caption":"Lochan-nah-Achlaise","height":47});
															thumbnails[2359933] = clik.newPhoto({"id":2359933,"src":"St-Cyrus-w-copy-11_thumb.jpg","galleries_id":153070,"server_id":5,"link":"photo_2359933.html","width":130,"caption":"St-Cyrus","height":46});
															thumbnails[2918999] = clik.newPhoto({"id":2918999,"src":"IMG_3389 Skye_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2918999.html","width":130,"caption":"Skye, Loch Harport to the Cuillins","height":86});
															thumbnails[8789434] = clik.newPhoto({"id":8789434,"src":"Clydeside-DSC_0601-w-copy1_thumb.jpg","galleries_id":462779,"server_id":5,"link":"photo_8789434.html","width":130,"caption":"Glasgow, Clydeside","height":86});
															thumbnails[2238912] = clik.newPhoto({"id":2238912,"src":"Argyll-Buchaille-Etive-Mor_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2238912.html","width":130,"caption":"Buchaille-Etive-Mor","height":126});
															thumbnails[2240611] = clik.newPhoto({"id":2240611,"src":"Black-Labradors-1135_thumb.jpg","galleries_id":147520,"server_id":5,"link":"photo_2240611.html","width":130,"caption":"Black Labradors","height":87});
															thumbnails[2240618] = clik.newPhoto({"id":2240618,"src":"Border-Terrier-1159_thumb.jpg","galleries_id":147520,"server_id":5,"link":"photo_2240618.html","width":130,"caption":"Border-Terrier","height":111});
															thumbnails[2240622] = clik.newPhoto({"id":2240622,"src":"Blair-Atholl-Horse-Show-dog_thumb.jpg","galleries_id":147520,"server_id":5,"link":"photo_2240622.html","width":130,"caption":"Yorkshire-Terrier","height":87});
															thumbnails[2240628] = clik.newPhoto({"id":2240628,"src":"Collie-1121_thumb.jpg","galleries_id":147520,"server_id":5,"link":"photo_2240628.html","width":130,"caption":"Collie","height":87});
															thumbnails[2240633] = clik.newPhoto({"id":2240633,"src":"Dog1123-_thumb.jpg","galleries_id":147520,"server_id":5,"link":"photo_2240633.html","width":130,"caption":"Dog","height":87});
															thumbnails[2242726] = clik.newPhoto({"id":2242726,"src":"Irish-Wolfhound-11301_thumb.jpg","galleries_id":147520,"server_id":5,"link":"photo_2242726.html","width":130,"caption":"Irish-Wolfhound","height":87});
															thumbnails[2242731] = clik.newPhoto({"id":2242731,"src":"Miniture-Schauzer-1161_thumb.jpg","galleries_id":147520,"server_id":5,"link":"photo_2242731.html","width":130,"caption":"Minature-Schnauzers","height":92});
															thumbnails[2242742] = clik.newPhoto({"id":2242742,"src":"Miniture-Schnauze-1142_thumb.jpg","galleries_id":147520,"server_id":5,"link":"photo_2242742.html","width":130,"caption":"Minature-Schnauzer","height":87});
															thumbnails[2238918] = clik.newPhoto({"id":2238918,"src":"Argyll-Kilchurn-Castle_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2238918.html","width":130,"caption":"Kilchurn castle","height":132});
															thumbnails[2238923] = clik.newPhoto({"id":2238923,"src":"Blair-Athol-Distillery_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2238923.html","width":130,"caption":"Blair-Athol-Distillery","height":133});
															thumbnails[2238927] = clik.newPhoto({"id":2238927,"src":"Caithness- Brough_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2238927.html","width":130,"caption":"Caithness-Brough","height":133});
															thumbnails[2238940] = clik.newPhoto({"id":2238940,"src":"Caithness- Crosskirk_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2238940.html","width":130,"caption":"Caithness-Crosskirk","height":133});
															thumbnails[2238953] = clik.newPhoto({"id":2238953,"src":"Caithness- Dale-Mill_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2238953.html","width":130,"caption":"Caithness-Dale-Mill","height":132});
															thumbnails[2238994] = clik.newPhoto({"id":2238994,"src":"Caithness, River-Thurso_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2238994.html","width":130,"caption":"Caithness-River-Thurso","height":133});
															thumbnails[2238996] = clik.newPhoto({"id":2238996,"src":"Caithness,-Burnthills,-stoo_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2238996.html","width":130,"caption":"Caithness-Stooks","height":136});
															thumbnails[2239002] = clik.newPhoto({"id":2239002,"src":"Caithness-Clett-Rock_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239002.html","width":130,"caption":"Caithness-Clett-Rock","height":129});
															thumbnails[2239007] = clik.newPhoto({"id":2239007,"src":"Caithness-Dunnet-Head-Ligh_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239007.html","width":130,"caption":"Caithness-Dunnet-Head","height":129});
															thumbnails[2239012] = clik.newPhoto({"id":2239012,"src":"Caithness-Fishermens-Hut,-_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239012.html","width":130,"caption":"Caithness-Fishermans-Hut","height":130});
															thumbnails[2239020] = clik.newPhoto({"id":2239020,"src":"Caithness-Loch-Calder_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239020.html","width":130,"caption":"Caithness-Loch-Calder","height":133});
															thumbnails[2239070] = clik.newPhoto({"id":2239070,"src":"Caithness-Stacks-of-Duncan_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239070.html","width":130,"caption":"Caithness-Stacks-of-Duncansbay","height":87});
															thumbnails[2239081] = clik.newPhoto({"id":2239081,"src":"Caithness-Tormore-House_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239081.html","width":130,"caption":"Caithness-Tormore-House-Christmas","height":135});
															thumbnails[2239085] = clik.newPhoto({"id":2239085,"src":"Fife-Anstruther-jpg_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239085.html","width":130,"caption":"Fife-Anstruther","height":135});
															thumbnails[2239092] = clik.newPhoto({"id":2239092,"src":"Fife-Pittenweem-5_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239092.html","width":130,"caption":"Fife-Pittenweem","height":87});
															thumbnails[2239094] = clik.newPhoto({"id":2239094,"src":"Glasgow-Armadillo_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239094.html","width":130,"caption":"Glasgow-Armadillo","height":87});
															thumbnails[2239099] = clik.newPhoto({"id":2239099,"src":"Glasgow-BBC-building_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239099.html","width":130,"caption":"Glasgow-River-Clyde-Evening","height":87});
															thumbnails[2239100] = clik.newPhoto({"id":2239100,"src":"Glasgow-Cathedral_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239100.html","width":130,"caption":"Glasgow-Cathedral","height":131});
															thumbnails[2239110] = clik.newPhoto({"id":2239110,"src":"Grampian-Balmoral-Castle-w_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239110.html","width":130,"caption":"Balmoral Castle","height":128});
															thumbnails[2239115] = clik.newPhoto({"id":2239115,"src":"Harris-Sound-of-Taransay_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239115.html","width":130,"caption":"Harris-Sound-of-Taransay","height":131});
															thumbnails[2239120] = clik.newPhoto({"id":2239120,"src":"Lewis-Callanish-Stones_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239120.html","width":130,"caption":"Lewis-Callanish-Stones","height":128});
															thumbnails[2239126] = clik.newPhoto({"id":2239126,"src":"Perthshire-Glen-Lyon-IMG_1_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239126.html","width":130,"caption":"Perthshire-Glen-Lyon","height":87});
															thumbnails[2239128] = clik.newPhoto({"id":2239128,"src":"Perthshire-Kinnoul-Hill-53_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239128.html","width":130,"caption":"Perthshire-Kinnoul-Hill","height":195});
															thumbnails[2239141] = clik.newPhoto({"id":2239141,"src":"Perthshire-Milton-of-Cluni_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239141.html","width":130,"caption":"Perthshire-Milton-of-Clunie","height":133});
															thumbnails[2239145] = clik.newPhoto({"id":2239145,"src":"Perthshir-The-Hermitage_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239145.html","width":130,"caption":"Perthshire-The-Hermitage","height":87});
															thumbnails[2239150] = clik.newPhoto({"id":2239150,"src":"Sutherland-Bighouse-Melvi_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239150.html","width":130,"caption":"Sutherland-Bighouse-Melvich","height":130});
															thumbnails[2239156] = clik.newPhoto({"id":2239156,"src":"Sutherland-Lochinver-&-Sui_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239156.html","width":130,"caption":"Sutherland-Suilven","height":127});
															thumbnails[2239165] = clik.newPhoto({"id":2239165,"src":"Sutherland-Loch-Stack-&-Ar_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239165.html","width":130,"caption":"Sutherland-Loch-Stack","height":134});
															thumbnails[2239170] = clik.newPhoto({"id":2239170,"src":"Sutherland-Old-Man-of-Stoe_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239170.html","width":130,"caption":"Sutherland-Old-Man-of-Stoer","height":128});
															thumbnails[2239178] = clik.newPhoto({"id":2239178,"src":"Sutherland-Sandwood-Bay_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239178.html","width":130,"caption":"Sutherland-Sandwood-Bay","height":130});
															thumbnails[2239194] = clik.newPhoto({"id":2239194,"src":"Sutherland-Strathy_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2239194.html","width":130,"caption":"Sutherland-Strathy","height":126});
															thumbnails[2242921] = clik.newPhoto({"id":2242921,"src":"Anchorage-South-Ballahullish1_thumb.jpg","galleries_id":147201,"server_id":5,"link":"photo_2242921.html","width":130,"caption":"Anchorage-South-Ballahullish","height":133});
															thumbnails[2242755] = clik.newPhoto({"id":2242755,"src":"Autumn-1716_thumb.jpg","galleries_id":147635,"server_id":5,"link":"photo_2242755.html","width":130,"caption":"Autumn","height":85});
															thumbnails[2242761] = clik.newPhoto({"id":2242761,"src":"Rhodedendron-2727_thumb.jpg","galleries_id":147635,"server_id":5,"link":"photo_2242761.html","width":130,"caption":"Rhodedendron","height":195});
															thumbnails[2242765] = clik.newPhoto({"id":2242765,"src":"river-and-rock_thumb.jpg","galleries_id":147635,"server_id":5,"link":"photo_2242765.html","width":130,"caption":"River-and-rock","height":87});
															thumbnails[2242772] = clik.newPhoto({"id":2242772,"src":"Tree-abstract-1615_thumb.jpg","galleries_id":147635,"server_id":5,"link":"photo_2242772.html","width":130,"caption":"Tree-abstract","height":87});
															thumbnails[2242781] = clik.newPhoto({"id":2242781,"src":"Brugge-0390_thumb.jpg","galleries_id":147638,"server_id":5,"link":"photo_2242781.html","width":130,"caption":"Brugge","height":87});
															thumbnails[2242784] = clik.newPhoto({"id":2242784,"src":"Brugge-0451_thumb.jpg","galleries_id":147638,"server_id":5,"link":"photo_2242784.html","width":130,"caption":"Brugge","height":87});
															thumbnails[2242791] = clik.newPhoto({"id":2242791,"src":"Brugge_0403_thumb.jpg","galleries_id":147638,"server_id":5,"link":"photo_2242791.html","width":130,"caption":"Brugge","height":87});
															thumbnails[2242798] = clik.newPhoto({"id":2242798,"src":"France- Annecy_thumb.jpg","galleries_id":147638,"server_id":5,"link":"photo_2242798.html","width":130,"caption":"France-Annecy","height":129});
															thumbnails[2242805] = clik.newPhoto({"id":2242805,"src":"Seefeld_thumb.jpg","galleries_id":147638,"server_id":5,"link":"photo_2242805.html","width":130,"caption":"Austria-Seefeld","height":87});
															thumbnails[2242808] = clik.newPhoto({"id":2242808,"src":"Seefeld-1_thumb.jpg","galleries_id":147638,"server_id":5,"link":"photo_2242808.html","width":130,"caption":"Austria-Seefeld","height":87});
															thumbnails[2242814] = clik.newPhoto({"id":2242814,"src":"Spain-1244_thumb.jpg","galleries_id":147638,"server_id":5,"link":"photo_2242814.html","width":130,"caption":"Spain-Pyrenees-Oden","height":87});
															thumbnails[2242975] = clik.newPhoto({"id":2242975,"src":"Rome-Trevi-Fountain-at-nigh_thumb.jpg","galleries_id":147638,"server_id":5,"link":"photo_2242975.html","width":130,"caption":"Rome-Trevi-Fountain","height":87});
															thumbnails[2242725] = clik.newPhoto({"id":2242725,"src":"Irish-Wolfhound-1130_thumb.jpg","galleries_id":147520,"server_id":5,"link":"photo_2242725.html","width":130,"caption":"Irish-Wolfhound","height":87});
															thumbnails[2348981] = clik.newPhoto({"id":2348981,"src":"Ben-Nevis-w-copy_thumb.jpg","galleries_id":153070,"server_id":5,"link":"photo_2348981.html","width":130,"caption":"Ben-Nevis","height":50});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[147520] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Animals","link":"gallery_147520.html","maxRecords":0.0,"photoIDs":[2240611.0,2240618.0,2240622.0,2240628.0,2240633.0,2242726.0,2242731.0,2242742.0,2242725.0],"skipIndex":0,"section_code":"gallery","featured_images":2240633.0,"id":147520,"singleSection":false});				  						galleries[267127] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Edinburgh Festival","link":"gallery_267127.html","maxRecords":0.0,"photoIDs":[8398196.0,8398216.0,8398225.0,6595672.0,6595731.0,6595743.0,6583043.0,6595778.0,4622997.0,4623209.0,4623235.0,4623249.0,4623258.0,4623307.0,4623319.0,4623323.0,4623326.0,4623339.0,4623347.0,4623351.0,4623552.0,4623562.0,4623582.0],"skipIndex":0,"section_code":"gallery","featured_images":"8398225,8398216,8398196,6595778,6595743,6595731,6595672,6583043,4623582,4623562","id":267127,"singleSection":false});				  						galleries[147638] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Europe","link":"gallery_147638.html","maxRecords":0.0,"photoIDs":[2242781.0,2242784.0,2242791.0,2242798.0,2242805.0,2242808.0,2242814.0,2242975.0],"skipIndex":0,"section_code":"gallery","featured_images":"2242975,2242814,2242808,2242805,2242798,2242791,2242784,2242781","id":147638,"singleSection":false});				  						galleries[462779] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Glasgow","link":"gallery_462779.html","maxRecords":0.0,"photoIDs":[8789434.0],"skipIndex":0,"section_code":"gallery","featured_images":8789434.0,"id":462779,"singleSection":false});				  						galleries[147635] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Nature","link":"gallery_147635.html","maxRecords":0.0,"photoIDs":[7845203.0,2242755.0,2242761.0,2242765.0,2242772.0],"skipIndex":0,"section_code":"gallery","featured_images":"7845203,2242772,2242765,2242761,2242755","id":147635,"singleSection":false});				  						galleries[153070] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Panoramic","link":"gallery_153070.html","maxRecords":0.0,"photoIDs":[2359915.0,2359917.0,2359933.0,2348981.0],"skipIndex":0,"section_code":"gallery","featured_images":2359915.0,"id":153070,"singleSection":false});				  						galleries[147201] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_147201.html","maxRecords":0.0,"photoIDs":[4634229.0,2237240.0,2918999.0,2238912.0,2238918.0,2238923.0,2238927.0,2238940.0,2238953.0,2238994.0,2238996.0,2239002.0,2239007.0,2239012.0,2239020.0,2239070.0,2239081.0,2239085.0,2239092.0,2239094.0,2239099.0,2239100.0,2239110.0,2239115.0,2239120.0,2239126.0,2239128.0,2239141.0,2239145.0,2239150.0,2239156.0,2239165.0,2239170.0,2239178.0,2239194.0,2242921.0],"skipIndex":0,"section_code":"gallery","featured_images":2239002.0,"id":147201,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8398196,2239115';
imageSets[2] = '2359915,2240633,2239002';
imageSets[3] = '2918999,2238953';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/MikeBruntonPhotography/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/MikeBruntonPhotography/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 = 'Mike Brunton Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				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 !== '' || 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;
	}
}

			

