window.thumbnails = new Object();
												thumbnails[268173] = new thumbnail(268173,'55333','Dunure Castle at Sunset','02 Dunure Castle Sunset Silhouette_thumb.jpg',130, 166,1,'photo_268173.html');
												thumbnails[268200] = new thumbnail(268200,'55331','Storm over Ayr','04 Storm Over Ayr from Dunure Castle_thumb.jpg',130, 83,1,'photo_268200.html');
												thumbnails[268207] = new thumbnail(268207,'55333','Reflections on Greenan Castle','07 Greenan Castle Reflections_thumb.jpg',130, 72,1,'photo_268207.html');
												thumbnails[268214] = new thumbnail(268214,'55331','Rainbow','11 Beach Rainbow_thumb.jpg',130, 195,1,'photo_268214.html');
												thumbnails[268216] = new thumbnail(268216,'55331','Ailsa Craig','10 Ailsa Craig Stormy Sky_thumb.jpg',130, 80,1,'photo_268216.html');
												thumbnails[268224] = new thumbnail(268224,'55329','Golden Beach','13 Golden Beach Light_thumb.jpg',130, 87,1,'photo_268224.html');
												thumbnails[268246] = new thumbnail(268246,'55333','Rocamadour by Night','01 Rocamadour Floodlit_thumb.jpg',130, 94,1,'photo_268246.html');
												thumbnails[268247] = new thumbnail(268247,'55336','Robin','03 Robin_thumb.jpg',130, 141,1,'photo_268247.html');
												thumbnails[268541] = new thumbnail(268541,'55337','Lightning Tree','03 Glen Trrol Lightning Tree_thumb.jpg',130, 64,1,'photo_268541.html');
												thumbnails[268544] = new thumbnail(268544,'55329','Cree Estuary','05 Cree Estuary Sunset_thumb.jpg',130, 87,1,'photo_268544.html');
												thumbnails[268545] = new thumbnail(268545,'55335','Tobermory Waterfront','06 Tobermory_thumb.jpg',130, 87,1,'photo_268545.html');
												thumbnails[268548] = new thumbnail(268548,'55337','Light and Shadow','04 Glen Trool Tree Shadows_thumb.jpg',130, 130,1,'photo_268548.html');
												thumbnails[268549] = new thumbnail(268549,'55329','Sound of Mull','10 Boat on Sound of Mull_thumb.jpg',130, 87,1,'photo_268549.html');
												thumbnails[268550] = new thumbnail(268550,'55331','Loch Lomond','19 Loch Lomond from Ben Lomond_thumb.jpg',130, 65,1,'photo_268550.html');
												thumbnails[268555] = new thumbnail(268555,'55331','Skye Sunrise','14 Sunrise from Old Man of Storr_thumb.jpg',130, 86,1,'photo_268555.html');
												thumbnails[268556] = new thumbnail(268556,'55330','Preshal Mor','13 Preshal Mor from Talisker Bay_thumb.jpg',130, 87,1,'photo_268556.html');
												thumbnails[316534] = new thumbnail(316534,'55333','Rocamadour','02 Rocamadour_thumb.jpg',130, 176,1,'photo_316534.html');
												thumbnails[316535] = new thumbnail(316535,'55335','L\'Hopitalet Church','03 L\'Hopitalet Church_thumb.jpg',130, 87,1,'photo_316535.html');
												thumbnails[316538] = new thumbnail(316538,'55335','Roofs of Cardaillac','04 Roofs of Cardaillac_thumb.jpg',130, 103,1,'photo_316538.html');
												thumbnails[316556] = new thumbnail(316556,'55333','Chateau des Anglaises','05 Chateau des Anglaises Autoire_thumb.jpg',130, 195,1,'photo_316556.html');
												thumbnails[316557] = new thumbnail(316557,'55335','Space Needle','09 Seattle from the Space Needle_thumb.jpg',130, 98,1,'photo_316557.html');
												thumbnails[438826] = new thumbnail(438826,'55329','River Dordogne at Dusk','10 Dordogne at Mauzac_thumb.jpg',130, 92,1,'photo_438826.html');
												thumbnails[438847] = new thumbnail(438847,'55335','Preparing for Lunch','11 St Emillion Cafe_thumb.jpg',130, 109,1,'photo_438847.html');
												thumbnails[438886] = new thumbnail(438886,'55329','Rock Pool','20 Golden light from Girvan Beach L_thumb.jpg',130, 86,1,'photo_438886.html');
												thumbnails[719590] = new thumbnail(719590,'55331','Arran Rainbow','acgill_061118_007_thumb.jpg',130, 87,1,'photo_719590.html');
												thumbnails[719650] = new thumbnail(719650,'55334','Smooth','acgill_061126_018_thumb.jpg',130, 89,1,'photo_719650.html');
												thumbnails[719703] = new thumbnail(719703,'55333','Dunure Cliffs','acgill_060930_059_thumb.jpg',130, 70,1,'photo_719703.html');
												thumbnails[719964] = new thumbnail(719964,'55333','Dunure Castle','CS5003_thumb.jpg',130, 86,1,'photo_719964.html');
												thumbnails[719965] = new thumbnail(719965,'55337','Flaming Bush','acgill_061105_023_thumb.jpg',130, 195,1,'photo_719965.html');
												thumbnails[719967] = new thumbnail(719967,'55337','Illumination','acgill_061118_012_thumb.jpg',130, 174,1,'photo_719967.html');
												thumbnails[719970] = new thumbnail(719970,'55337','Autumnal Spotlight','acgill_061208_015_thumb.jpg',130, 195,1,'photo_719970.html');
												thumbnails[719989] = new thumbnail(719989,'55337','Swamp','acgill_061208_023_thumb.jpg',130, 84,1,'photo_719989.html');
												thumbnails[719992] = new thumbnail(719992,'55337','Winter Tree','acgill_061230_056_thumb.jpg',130, 195,1,'photo_719992.html');
												thumbnails[719994] = new thumbnail(719994,'55336','Singing for his Supper','04 Robin_thumb.jpg',130, 137,1,'photo_719994.html');
												thumbnails[720000] = new thumbnail(720000,'55336','Heron','06 Heron_thumb.jpg',130, 92,1,'photo_720000.html');
												thumbnails[720008] = new thumbnail(720008,'55335','Blackrock Cottage','acgill_061004_060_thumb.jpg',130, 146,1,'photo_720008.html');
												thumbnails[720016] = new thumbnail(720016,'55335','Old Kirk, Alloway','LA5012_thumb.jpg',130, 94,1,'photo_720016.html');
												thumbnails[725667] = new thumbnail(725667,'55330','Buachaille Etive Mor Dawn','acgill_061004_004_thumb.jpg',130, 195,1,'photo_725667.html');
												thumbnails[725673] = new thumbnail(725673,'55330','Golden River','acgill_061004_012_thumb.jpg',130, 87,1,'photo_725673.html');
												thumbnails[725679] = new thumbnail(725679,'55330','Ben Lomond','acgill_061004_063_thumb.jpg',130, 130,1,'photo_725679.html');
												thumbnails[725681] = new thumbnail(725681,'55330','Wastwater','08 Wastwater_thumb.jpg',130, 87,1,'photo_725681.html');
												thumbnails[725682] = new thumbnail(725682,'55330','The original Skye Bridge','acgill_061014_011_thumb.jpg',130, 87,1,'photo_725682.html');
												thumbnails[725685] = new thumbnail(725685,'55330','Where in the World','acgill_061016_031_mono_thumb.jpg',130, 98,1,'photo_725685.html');
												thumbnails[725691] = new thumbnail(725691,'55330','Why it\'s called the Old Man of Storr.','acgill_061016_047_thumb.jpg',130, 117,1,'photo_725691.html');
												thumbnails[725693] = new thumbnail(725693,'55330','Geologists\' Dream','acgill_061016_054_thumb.jpg',130, 87,1,'photo_725693.html');
												thumbnails[738107] = new thumbnail(738107,'55329','Mirror Loch','acgill_061004_053_thumb.jpg',130, 87,1,'photo_738107.html');
												thumbnails[738110] = new thumbnail(738110,'55329','Autumn Reflections','acgill_061208_016_thumb.jpg',130, 87,1,'photo_738110.html');
												thumbnails[738112] = new thumbnail(738112,'55329','Morning Yacht','BT5002_thumb.jpg',130, 195,1,'photo_738112.html');
												thumbnails[738114] = new thumbnail(738114,'55329','Loch Garry View','LA5011_thumb.jpg',130, 178,1,'photo_738114.html');
												thumbnails[738115] = new thumbnail(738115,'55329','The Power of Water','LA5014_thumb.jpg',130, 178,1,'photo_738115.html');
												thumbnails[738119] = new thumbnail(738119,'55329','Golden Sea','acgill_060806_099_thumb.jpg',130, 139,1,'photo_738119.html');
												thumbnails[766797] = new thumbnail(766797,'55329','Muddy River Ayr','02-R-Ayr-near-Failford_thumb.jpg',130, 128,1,'photo_766797.html');
												thumbnails[766816] = new thumbnail(766816,'55334','Hillside','50-Closeup-across-Derwentwa_thumb.jpg',130, 87,1,'photo_766816.html');
												thumbnails[767119] = new thumbnail(767119,'55331','Loch Lomond Sunlight','acgill_061004_068_thumb.jpg',130, 167,1,'photo_767119.html');
												thumbnails[767127] = new thumbnail(767127,'55331','Gathering Storm','acgill_061106_003_thumb.jpg',130, 83,1,'photo_767127.html');
												thumbnails[767134] = new thumbnail(767134,'55331','Ailsa Sunbeam','LA5018_thumb.jpg',130, 87,1,'photo_767134.html');
												thumbnails[767136] = new thumbnail(767136,'55331','The Hanging Tree','acgill_061230_052_thumb.jpg',130, 181,1,'photo_767136.html');
												thumbnails[767146] = new thumbnail(767146,'55333','Greenan Sunset','acgill_060718_011_thumb.jpg',130, 179,1,'photo_767146.html');
												thumbnails[767152] = new thumbnail(767152,'55335','Medieval Skyscraper','07 Gramat Church_thumb.jpg',130, 196,1,'photo_767152.html');
												thumbnails[767161] = new thumbnail(767161,'55335','Blue Solway','acgill_060727_035_thumb.jpg',130, 64,1,'photo_767161.html');
												thumbnails[767169] = new thumbnail(767169,'55336','Fight!','02 Stag Fight_thumb.jpg',130, 87,1,'photo_767169.html');
												thumbnails[767171] = new thumbnail(767171,'55336','Heeland Coo','05 Highland Cow_thumb.jpg',130, 161,1,'photo_767171.html');
												thumbnails[767175] = new thumbnail(767175,'55336','Sleeping Seal','11-Seal_thumb.jpg',130, 81,1,'photo_767175.html');
												thumbnails[767179] = new thumbnail(767179,'55336','I\'ve wet the bed!','10-Seal_thumb.jpg',130, 83,1,'photo_767179.html');
												thumbnails[767185] = new thumbnail(767185,'55336','Big Eyes','19-Seal_thumb.jpg',130, 116,1,'photo_767185.html');
												thumbnails[1250650] = new thumbnail(1250650,'55326','Ailsa Craig at Dusk','acgill_070520_024_thumb.jpg',130, 85,1,'photo_1250650.html');
												thumbnails[1250655] = new thumbnail(1250655,'55326','Evening Rock','acgill_070525_017_thumb.jpg',130, 173,1,'photo_1250655.html');
												thumbnails[1250657] = new thumbnail(1250657,'55326','Ayrshire Dusk','acgill_070525_026_thumb.jpg',130, 170,1,'photo_1250657.html');
												thumbnails[1250687] = new thumbnail(1250687,'55330','Loch Leven Winter','acgill_070322_076_thumb.jpg',130, 87,1,'photo_1250687.html');
												thumbnails[1250743] = new thumbnail(1250743,'55327','Reflections on a Beach','acgill_070127_011_thumb.jpg',130, 195,1,'photo_1250743.html');
												thumbnails[1250744] = new thumbnail(1250744,'55327','Nest of Stones','acgill_070224_039_thumb.jpg',130, 178,1,'photo_1250744.html');
												thumbnails[1250766] = new thumbnail(1250766,'55327','Clouds and Cliffs','acgill_070224_018_mono_thumb.jpg',130, 65,1,'photo_1250766.html');
												thumbnails[1250778] = new thumbnail(1250778,'55331','Sea on Fire','acgill_070212_030_thumb.jpg',130, 86,1,'photo_1250778.html');
												thumbnails[1250799] = new thumbnail(1250799,'55329','Loch Leven Morning','acgill_070322_097_thumb.jpg',130, 87,1,'photo_1250799.html');
												thumbnails[268171] = new thumbnail(268171,'55333','Dunure Castle','01 Dunure Castle_thumb.jpg',130, 84,1,'photo_268171.html');
												thumbnails[268210] = new thumbnail(268210,'55327','Light on a Beach','08 Evening Light on Beach_thumb.jpg',130, 177,1,'photo_268210.html');
												thumbnails[268543] = new thumbnail(268543,'55328','Port Logan','02 Fisherman at Portpatrick_thumb.jpg',130, 200,1,'photo_268543.html');
												thumbnails[438880] = new thumbnail(438880,'55326','Golden Isle','19 Ailsa Golden light from Girvan Beach_thumb.jpg',130, 197,1,'photo_438880.html');
												thumbnails[5356352] = new thumbnail(5356352,'301678','Dunure Harbour at Dusk','04-Dunure-Harbour-after-Sundown_thumb.jpg',130, 127,1,'photo_5356352.html');
												thumbnails[5356879] = new thumbnail(5356879,'301678','Castle and Cliffs','bacgill_04012009_050_thumb.jpg',130, 87,1,'photo_5356879.html');
												thumbnails[268164] = new thumbnail(268164,'55329','Arran at Sunset','09 Sunset over Arran_thumb.jpg',130, 86,1,'photo_268164.html');
												thumbnails[268197] = new thumbnail(268197,'55327','Isle of Arran from Dunure Harbour','03 Arran from Dunure Harbour_thumb.jpg',130, 92,1,'photo_268197.html');
												thumbnails[268547] = new thumbnail(268547,'55328','Rubha nan Gall Lighthouse','08 Rubha nan Gall Lighthouse_thumb.jpg',130, 87,1,'photo_268547.html');
												thumbnails[766766] = new thumbnail(766766,'55326','Ailsa Craig at Dusk','66-Golden-light-from-Girvan_thumb.jpg',130, 87,1,'photo_766766.html');
												thumbnails[5356353] = new thumbnail(5356353,'301678','Dunure Castle from the north','13-Dunure-Castle-with-Sea-L_thumb.jpg',130, 85,1,'photo_5356353.html');
												thumbnails[5356880] = new thumbnail(5356880,'301678','Castle and Cliffs 2','bacgill_04052009_026_thumb.jpg',130, 130,1,'photo_5356880.html');
												thumbnails[268204] = new thumbnail(268204,'55327','Wave of Sunshine','05 Wave of Sunshine_thumb.jpg',130, 87,1,'photo_268204.html');
												thumbnails[268245] = new thumbnail(268245,'55328','Rubha nan Gall Lighthouse','09 Ferry Passes Rubha nan Gall Lighthouse_thumb.jpg',130, 77,1,'photo_268245.html');
												thumbnails[719412] = new thumbnail(719412,'55326','Ailsa Craig Sunset','LA5016_thumb.jpg',130, 87,1,'photo_719412.html');
												thumbnails[5356354] = new thumbnail(5356354,'301678','Dunure Castle and Dove Cote from the beach','acgill_06072009_006_thumb.jpg',130, 91,1,'photo_5356354.html');
												thumbnails[5356881] = new thumbnail(5356881,'301678','Wild Coast','bacgill_06072009_005_thumb.jpg',130, 102,1,'photo_5356881.html');
												thumbnails[268553] = new thumbnail(268553,'55327','Camastianavaig Bay','16 Camastianavaig Bay_thumb.jpg',130, 75,1,'photo_268553.html');
												thumbnails[719640] = new thumbnail(719640,'55328','On the Rocks','acgill_061020_041_thumb.jpg',130, 98,1,'photo_719640.html');
												thumbnails[766767] = new thumbnail(766767,'55326','Sunset Over Arran','acgill_060718_004_thumb.jpg',130, 86,1,'photo_766767.html');
												thumbnails[5356355] = new thumbnail(5356355,'301678','Castle from the beach, late summer afternoon','acgill_06072009_015_thumb.jpg',130, 195,1,'photo_5356355.html');
												thumbnails[5356882] = new thumbnail(5356882,'301678','Evening Low Tide','bacgill_06072009_031_thumb.jpg',130, 87,1,'photo_5356882.html');
												thumbnails[268546] = new thumbnail(268546,'55328','Sanna Point','07 Ardnamurchan Lighthouse_thumb.jpg',130, 73,1,'photo_268546.html');
												thumbnails[268552] = new thumbnail(268552,'55327','Camastianavaig Bay','17 Sunrise over Camastianavaig Bay_thumb.jpg',130, 87,1,'photo_268552.html');
												thumbnails[766778] = new thumbnail(766778,'55326','Red Sky at Night','acgill_060718_032_thumb.jpg',130, 82,1,'photo_766778.html');
												thumbnails[5356356] = new thumbnail(5356356,'301678','Castle and Gorse','acgill_080116_021_thumb.jpg',130, 82,1,'photo_5356356.html');
												thumbnails[5356883] = new thumbnail(5356883,'301678','Ailsa Craig from Dunure','bacgill_06072009_048_thumb.jpg',130, 87,1,'photo_5356883.html');
												thumbnails[268235] = new thumbnail(268235,'55327','Beach Reflections','15 Beach at Culzean_thumb.jpg',130, 195,1,'photo_268235.html');
												thumbnails[719402] = new thumbnail(719402,'55326','Fishing by Ailsa Craig','acgill_061208_018_thumb.jpg',130, 176,1,'photo_719402.html');
												thumbnails[719628] = new thumbnail(719628,'55328','Neist Point Lighthouse','acgill_061020_025_thumb.jpg',130, 195,1,'photo_719628.html');
												thumbnails[5356357] = new thumbnail(5356357,'301678','Arran Sunset','acgill_080414_013_thumb.jpg',130, 85,1,'photo_5356357.html');
												thumbnails[5356884] = new thumbnail(5356884,'301678','Evening Light','bacgill_06072009_050_thumb.jpg',130, 87,1,'photo_5356884.html');
												thumbnails[268542] = new thumbnail(268542,'55327','Mossyard Sunrise','01 Sunset at Mossyard_thumb.jpg',130, 198,1,'photo_268542.html');
												thumbnails[719575] = new thumbnail(719575,'55326','Snowy Arran','acgill_061118_009_thumb.jpg',130, 87,1,'photo_719575.html');
												thumbnails[719644] = new thumbnail(719644,'55328','Neist Point Lighthouse with Sea','acgill_061020_043_thumb.jpg',130, 196,1,'photo_719644.html');
												thumbnails[5356358] = new thumbnail(5356358,'301678','Path to the Sea','acgill_090310_008_thumb.jpg',130, 195,1,'photo_5356358.html');
												thumbnails[5356885] = new thumbnail(5356885,'301678','Peaceful Bay','bacgill_080116_023_thumb.jpg',130, 87,1,'photo_5356885.html');
												thumbnails[268254] = new thumbnail(268254,'55328','Black Head Lighthouse','01 Black Head Lighthouse_thumb.jpg',130, 175,1,'photo_268254.html');
												thumbnails[268554] = new thumbnail(268554,'55327','Bearreraig Bay','15 Bearreraig Bay_thumb.jpg',130, 73,1,'photo_268554.html');
												thumbnails[5356359] = new thumbnail(5356359,'301678','Castle at Sunset','acgill_090310_055_thumb.jpg',130, 82,1,'photo_5356359.html');
												thumbnails[5356886] = new thumbnail(5356886,'301678','Evening Calm','bacgill_080116_024_thumb.jpg',130, 195,1,'photo_5356886.html');
												thumbnails[268557] = new thumbnail(268557,'55327','Plockton','12 Canoe at Plockton_thumb.jpg',130, 87,1,'photo_268557.html');
												thumbnails[438870] = new thumbnail(438870,'55328','Dunure Harbour after Sundown','18 Dunure Harbour after Sundown_thumb.jpg',130, 110,1,'photo_438870.html');
												thumbnails[5356360] = new thumbnail(5356360,'301678','Favourite Rest Stop','acgill_090310_068_thumb.jpg',130, 87,1,'photo_5356360.html');
												thumbnails[5356887] = new thumbnail(5356887,'301678','The Place to Savour the View','bacgill_090310_054_thumb.jpg',130, 174,1,'photo_5356887.html');
												thumbnails[738106] = new thumbnail(738106,'55327','Sound of Mull','11 Mull from Ardnamurchan_thumb.jpg',130, 76,1,'photo_738106.html');
												thumbnails[5356361] = new thumbnail(5356361,'301678','Night Falls','acgill_09152009_095_thumb.jpg',130, 83,1,'photo_5356361.html');
												thumbnails[5356888] = new thumbnail(5356888,'301678','Evening Panorama','bacgill_09152009_099_thumb.jpg',130, 58,1,'photo_5356888.html');
												thumbnails[438879] = new thumbnail(438879,'55327','Girvan Beach','17 Girvan Beach cloud reflections_thumb.jpg',130, 89,1,'photo_438879.html');
												thumbnails[738121] = new thumbnail(738121,'55327','Sea and Skye','acgill_061015_034_thumb.jpg',130, 195,1,'photo_738121.html');
												thumbnails[738123] = new thumbnail(738123,'55327','Talisker Dusk','acgill_061015_057_thumb.jpg',130, 195,1,'photo_738123.html');
												thumbnails[738126] = new thumbnail(738126,'55327','Fiskavaig Sunset','acgill_061017_079_thumb.jpg',130, 84,1,'photo_738126.html');
												thumbnails[738127] = new thumbnail(738127,'55327','Duirinish Sheep','acgill_061020_024_thumb.jpg',130, 87,1,'photo_738127.html');
												thumbnails[738124] = new thumbnail(738124,'55327','Elgol Rock','acgill_061017_041_thumb.jpg',130, 85,1,'photo_738124.html');
												thumbnails[738125] = new thumbnail(738125,'55327','Cuillin View','acgill_061017_068_thumb.jpg',130, 85,1,'photo_738125.html');
												thumbnails[316566] = new thumbnail(316566,'55327','Chasing the Birds','06 Chasing Seagulls_thumb.jpg',130, 54,1,'photo_316566.html');
												thumbnails[719570] = new thumbnail(719570,'55327','Mermaid Rocks','acgill_061208_022_thumb.jpg',130, 85,1,'photo_719570.html');
												thumbnails[719673] = new thumbnail(719673,'55327','Harbour Decay','acgill_061226_044_thumb.jpg',130, 77,1,'photo_719673.html');
												thumbnails[738118] = new thumbnail(738118,'55327','Evening Rocks','acgill_060806_087_thumb.jpg',130, 87,1,'photo_738118.html');
												thumbnails[738120] = new thumbnail(738120,'55327','Cliffs','acgill_060905_003_thumb.jpg',130, 83,1,'photo_738120.html');
												thumbnails[738122] = new thumbnail(738122,'55327','Skye and Sunset','acgill_061015_049_thumb.jpg',130, 87,1,'photo_738122.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[55326] = new gallery(55326,'1250657,1250655,1250650,766778,766767,766766,719575,719412,719402,438880','Islands','gallery',[1250650,1250655,1250657,438880,766766,719412,766767,766778,719402,719575],0, 0, '', 'gallery_55326.html',0,0);
				  					galleries[55327] = new gallery(55327,'1250766,1250744,1250743,738127,738126,738125,738124,738123,738122,738121','Coast','gallery',[1250743,1250744,1250766,268210,268197,268204,268553,268552,268235,268542,268554,268557,738106,438879,738121,738123,738126,738127,738124,738125,316566,719570,719673,738118,738120,738122],0, 0, '', 'gallery_55327.html',0,0);
				  					galleries[55328] = new gallery(55328,'719644,719640,719628,438870,268547,268546,268543,268254,268245','Lighthouses','gallery',[268543,268547,268245,719640,268546,719628,719644,268254,438870],0, 0, '', 'gallery_55328.html',0,0);
				  					galleries[55329] = new gallery(55329,'1250799,766797,738119,738115,738114,738112,738110,738107,438886,438826','Water','gallery',[268224,268544,268549,438826,438886,738107,738110,738112,738114,738115,738119,766797,1250799,268164],0, 0, '', 'gallery_55329.html',0,0);
				  					galleries[55330] = new gallery(55330,'1250687,725693,725691,725685,725682,725681,725679,725673,725667,268556','Mountains','gallery',[268556,725667,725673,725679,725681,725682,725685,725691,725693,1250687],0, 0, '', 'gallery_55330.html',0,0);
				  					galleries[55331] = new gallery(55331,'1250778,767136,767134,767127,767119,719590,268555,268550,268216,268214','Weather','gallery',[268200,268214,268216,268550,268555,719590,767119,767127,767134,767136,1250778],0, 0, '', 'gallery_55331.html',0,0);
				  					galleries[55333] = new gallery(55333,'268207','Castles','gallery',[268173,268207,268246,316534,316556,719703,719964,767146,268171],0, 0, '', 'gallery_55333.html',0,0);
				  					galleries[55334] = new gallery(55334,'766816,719650','Inner Landscapes','gallery',[719650,766816],0, 0, '', 'gallery_55334.html',0,0);
				  					galleries[55335] = new gallery(55335,'767161,767152,720016,720008,438847,316557,316538,316535,268545','The Stamp of Man','gallery',[268545,316535,316538,316557,438847,720008,720016,767152,767161],0, 0, '', 'gallery_55335.html',0,0);
				  					galleries[55336] = new gallery(55336,'767185,767179,767175,767171,767169,720000,719994,268247','Animals','gallery',[268247,719994,720000,767169,767171,767175,767179,767185],0, 0, '', 'gallery_55336.html',0,0);
				  					galleries[55337] = new gallery(55337,'719992,719989,719970,719967,719965,268548,268541','Trees and Plants','gallery',[268541,268548,719965,719967,719970,719989,719992],0, 0, '', 'gallery_55337.html',0,0);
				  					galleries[301678] = new gallery(301678,'5356888,5356887,5356886,5356885,5356884,5356883,5356882,5356881,5356880,5356879','Dunure','gallery',[5356352,5356879,5356353,5356880,5356354,5356881,5356355,5356882,5356356,5356883,5356357,5356884,5356358,5356885,5356359,5356886,5356360,5356887,5356361,5356888],0, 0, '', 'gallery_301678.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '1250799,1250687,1250650,767161,767119,766778,766766,738123,738122,738107,438886,268553,268245,268164';
imageSets[2] = '268207';
imageSets[3] = '5356888,5356887,5356886,5356885,5356884,5356883,5356882,5356881,5356880,5356879,5356361,5356360,5356359,5356358,5356357,5356356,5356355,5356354,5356353,5356352,1250799,1250778,1250766,1250744,1250743,1250687,1250657,1250655,1250650,767185,767179,767175,767171,767169,767161,767152,767146,767136,767134,767127,767119,766816,766797,766778,766767,766766,738127,738126,738125,738124';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/andygill/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/andygill/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/andygill/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/andygill/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/andygill/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/andygill/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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Andy Gill Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp = temp + '<p>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = 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 = temp + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="item_name" value="'+item_name+'">';
								ref = '';
				if(this.photo_ref != ''){
					ref = this.photo_ref+' - '+this.caption;
				}
				else{
					ref = this.id+' - '+this.caption;
				}
				price = amount;					temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="sumo.gill@virgin.net">';
	temp = temp + '<input type="hidden" name="currency_code" value="GBP">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="sumo.gill@virgin.net">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							temp = 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({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* 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 + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

