window.thumbnails = new Object();
												thumbnails[2173389] = new thumbnail(2173389,'','Greenknowe Tower','2168_AAB0978-2_thumb.jpg',130, 72,18,'#');
												thumbnails[2173400] = new thumbnail(2173400,'','','2197_AAB1096_thumb.jpg',130, 69,18,'#');
												thumbnails[2173402] = new thumbnail(2173402,'','','2204_AAB1166_thumb.jpg',130, 87,18,'#');
												thumbnails[2173425] = new thumbnail(2173425,'','','Camera looking to sitting area_thumb.jpg',130, 84,18,'#');
												thumbnails[7893361] = new thumbnail(7893361,'','Fishers at Selkirk Cauld','Fishers_at_Selkirk_cauld_RC_thumb.JPG',130, 93,18,'#');
												thumbnails[7893370] = new thumbnail(7893370,'','On the Yarrow','On_the_Yarrow_with_woman_thumb.jpg',130, 92,18,'#');
												thumbnails[1439077] = new thumbnail(1439077,'98962','','IMG0016_thumb.jpg',130, 70,18,'photo_1439077.html');
												thumbnails[1439080] = new thumbnail(1439080,'98962','Steam train in the Borders','IMG0046_thumb.jpg',130, 78,18,'photo_1439080.html');
												thumbnails[1446720] = new thumbnail(1446720,'98962','Border shepherd with Border Collies and sheep in a blizzard','IMG0003_thumb.jpg',130, 91,18,'photo_1446720.html');
												thumbnails[1446721] = new thumbnail(1446721,'98962','Water bailiffs on the cauld on the River Ettrick at Selkirk during the salmon run','IMG0050_thumb.jpg',130, 85,18,'photo_1446721.html');
												thumbnails[2245510] = new thumbnail(2245510,'147757','Shepherd','0003_thumb.jpg',130, 73,18,'photo_2245510.html');
												thumbnails[2245512] = new thumbnail(2245512,'147757','Hay yard at Sunderlandhall Farm','07 July - Hay yard at Sunderlandhall Farm_thumb.jpg',130, 79,18,'photo_2245512.html');
												thumbnails[2245513] = new thumbnail(2245513,'147757','Harvest at Shawmount','08 August - Harvest at Shawmount_thumb.jpg',130, 94,18,'photo_2245513.html');
												thumbnails[2245514] = new thumbnail(2245514,'147757','Harvesting at Bowden','09 September - Harvesting at Bowden_thumb.jpg',130, 102,18,'photo_2245514.html');
												thumbnails[2245515] = new thumbnail(2245515,'147757','Sheep up Yarrow','0010_thumb.jpg',130, 87,18,'photo_2245515.html');
												thumbnails[2245516] = new thumbnail(2245516,'147757','Threshing','11 November - Threshing_thumb.jpg',130, 87,18,'photo_2245516.html');
												thumbnails[2245517] = new thumbnail(2245517,'147757','Going home, Broomhill','12 December - Going home, Broomhill_thumb.jpg',130, 100,18,'photo_2245517.html');
												thumbnails[2245518] = new thumbnail(2245518,'147757','Bondager','Bondager_thumb.jpg',130, 195,18,'photo_2245518.html');
												thumbnails[2245521] = new thumbnail(2245521,'147758','Train near the Eildons, Melrose','Camera Club006 a_thumb.jpg',130, 77,18,'photo_2245521.html');
												thumbnails[2245524] = new thumbnail(2245524,'147757','Ploughing at Shawmount','Cover - Ploughing at Shawmount_thumb.jpg',130, 73,18,'photo_2245524.html');
												thumbnails[2245525] = new thumbnail(2245525,'147758','Earlston Station','Earlston001_thumb.jpg',130, 93,18,'photo_2245525.html');
												thumbnails[2245526] = new thumbnail(2245526,'147758','Fountainhall','Fountainhall_thumb.jpg',130, 88,18,'photo_2245526.html');
												thumbnails[2245530] = new thumbnail(2245530,'147758','Galashiels Train station','Gala Station_thumb.jpg',130, 81,18,'photo_2245530.html');
												thumbnails[2245531] = new thumbnail(2245531,'147757','Tractor Harvesting 1950','Harvesting 1950_thumb.jpg',130, 70,18,'photo_2245531.html');
												thumbnails[2245534] = new thumbnail(2245534,'147758','Train at Hassendean','Hassendean_thumb.jpg',130, 78,18,'photo_2245534.html');
												thumbnails[2245537] = new thumbnail(2245537,'147758','Train at Berwick upon Tweed','Hush Hush_thumb.jpg',130, 67,18,'photo_2245537.html');
												thumbnails[2245539] = new thumbnail(2245539,'147758','Train at Galashiels ','Railway Galashiels 1955_thumb.jpg',130, 166,18,'photo_2245539.html');
												thumbnails[2245541] = new thumbnail(2245541,'147758','Train at Torwoodlee 1955','Railway Torwoodlee 1955_thumb.jpg',130, 80,18,'photo_2245541.html');
												thumbnails[7896561] = new thumbnail(7896561,'425844','Auld Brig Road','Auld-Brig-Road_thumb.jpg',130, 95,18,'photo_7896561.html');
												thumbnails[7896565] = new thumbnail(7896565,'425844','Sheep clipping','Clipping-group_thumb.jpg',130, 91,18,'photo_7896565.html');
												thumbnails[7896568] = new thumbnail(7896568,'425844','Coming Home, Broomhill Farm, Selkirk','Coming-Home_thumb.jpg',130, 98,18,'photo_7896568.html');
												thumbnails[7896570] = new thumbnail(7896570,'425844','Cornmill Selkirk','Corn-Mill-2_thumb.jpg',130, 91,18,'photo_7896570.html');
												thumbnails[7896573] = new thumbnail(7896573,'425844','Coach leaving for Railway Station from County Hotel, Selkirk','County-Hotel-railway-coach_thumb.jpg',130, 101,18,'photo_7896573.html');
												thumbnails[7896575] = new thumbnail(7896575,'425844','Curling competition, Loch o the Lowes, Yarrow','Curling-comp-cleaned_thumb.jpg',130, 91,18,'photo_7896575.html');
												thumbnails[7896577] = new thumbnail(7896577,'425844','Curling on snow covered Loch o the Lowes','Curling-Loch-o-the-Lowes_thumb.jpg',130, 94,18,'photo_7896577.html');
												thumbnails[7896581] = new thumbnail(7896581,'425844','View of Ettrickbridgend from bridge, Ettrick','Ettrickbridgend_thumb.jpg',130, 98,18,'photo_7896581.html');
												thumbnails[7896582] = new thumbnail(7896582,'425844','Passenger coach passing through Ettrickbridgend, Ettrick','Ettrickbridgend-coach-passi_thumb.jpg',130, 98,18,'photo_7896582.html');
												thumbnails[7896586] = new thumbnail(7896586,'425844','Fishing at Selkirk Cauld','Fishers-at-Selkirk-cauld-RC_thumb.jpg',130, 93,18,'photo_7896586.html');
												thumbnails[7896590] = new thumbnail(7896590,'425844','Foulshiels Farm, Yarrow','Foulshiels-Farm_thumb.jpg',130, 100,18,'photo_7896590.html');
												thumbnails[7896593] = new thumbnail(7896593,'425844','General\'s Bridge, Yarrow','Generals-Bridge_thumb.jpg',130, 105,18,'photo_7896593.html');
												thumbnails[7896596] = new thumbnail(7896596,'425844','Curling rink at The Haining, Selkirk','Group-curling-Haining_thumb.jpg',130, 100,18,'photo_7896596.html');
												thumbnails[7896597] = new thumbnail(7896597,'425844','Kit Watson, shepherd, Lewinshope, Yarrow','Kit-Watson_thumb.jpg',130, 87,18,'photo_7896597.html');
												thumbnails[7896598] = new thumbnail(7896598,'425844','Logging, Linglie Glen, Selkirk','Linglie-with-horses-logging_thumb.jpg',130, 179,18,'photo_7896598.html');
												thumbnails[7896604] = new thumbnail(7896604,'425844','Logging with horses, Linglie Glen','Logging-horses-in-Linglie-G_thumb.jpg',130, 100,18,'photo_7896604.html');
												thumbnails[7896607] = new thumbnail(7896607,'425844','Newark Tower, Yarrow','Newark-Tower_thumb.jpg',130, 96,18,'photo_7896607.html');
												thumbnails[7896609] = new thumbnail(7896609,'425844','On the Yarrow','On-the-Yarrow-with-woman_thumb.jpg',130, 92,18,'photo_7896609.html');
												thumbnails[7896613] = new thumbnail(7896613,'425844','Sunset at Malsheugh, River Ettrick, Selkirk','River-Ettrick-at-Maulsheugh_thumb.jpg',130, 103,18,'photo_7896613.html');
												thumbnails[7896617] = new thumbnail(7896617,'425844','Sheep crossing at St Mary\'s Loch, Yarrow','St-Marys-sheep-crossing_thumb.jpg',130, 95,18,'photo_7896617.html');
												thumbnails[7896620] = new thumbnail(7896620,'425844','Threshing ','Threshing-2_thumb.jpg',130, 86,18,'photo_7896620.html');
												thumbnails[2173412] = new thumbnail(2173412,'145014','ROBERT D CLAPPERTON 1834-1918','Robert Clapperton_thumb.jpg',130, 160,18,'photo_2173412.html');
												thumbnails[2173437] = new thumbnail(2173437,'145019','The entrance to the original daylight studio','Studio exterior entrance_thumb.jpg',130, 87,18,'photo_2173437.html');
												thumbnails[3940505] = new thumbnail(3940505,'239204','Standard Bearer G Roberts 1929','Standard_Bearer_G_Roberts_1929_thumb.jpg',130, 175,18,'photo_3940505.html');
												thumbnails[3950293] = new thumbnail(3950293,'239203','Procession going Doon The Green','Start_of_Burleymen_1899_thumb.jpg',130, 103,18,'photo_3950293.html');
												thumbnails[3982442] = new thumbnail(3982442,'239205','Standard Bearer Elliot Anderson','Standard_Bearer_Elliot_Anderson_thumb.jpg',130, 157,18,'photo_3982442.html');
												thumbnails[3982455] = new thumbnail(3982455,'239206','Standard Bearer Keith Monks','Standard_Bearer_Keith_Monks_2_thumb.jpg',130, 92,18,'photo_3982455.html');
												thumbnails[3985999] = new thumbnail(3985999,'240846','Standard Bearer Kellet and attendants','Standard_Bearer_Kellett_and_attendants_thumb.jpg',130, 88,18,'photo_3985999.html');
												thumbnails[2173423] = new thumbnail(2173423,'145014','WILLIAM MITCHELL           1869 - 1944','William Mitchell_thumb.jpg',130, 174,18,'photo_2173423.html');
												thumbnails[2173441] = new thumbnail(2173441,'145019','The outside of the studio showing the daylight section','Studio exterior side_thumb.jpg',130, 111,18,'photo_2173441.html');
												thumbnails[3940547] = new thumbnail(3940547,'239204','1929 Standard Bearer G Roberts and attendants','Standard_Bearer_Roberts_and_attendants_thumb.jpg',130, 99,18,'photo_3940547.html');
												thumbnails[3950295] = new thumbnail(3950295,'239203','Casting the Colours 1899','Casting_the_Colours_1899_thumb.jpg',130, 106,18,'photo_3950295.html');
												thumbnails[3982444] = new thumbnail(3982444,'239205','Standard Bearer Anderson and attendants','SB_Anderson_and_attendants_thumb.jpg',130, 85,18,'photo_3982444.html');
												thumbnails[3982464] = new thumbnail(3982464,'239206','Standard Bearer Monks and attendants','SB_Monks_and_attendants_thumb.jpg',130, 88,18,'photo_3982464.html');
												thumbnails[3986001] = new thumbnail(3986001,'240846','Crying of the Burley','Crying_of_the_Burley_thumb.jpg',130, 89,18,'photo_3986001.html');
												thumbnails[2173419] = new thumbnail(2173419,'145014','WILLIAM McLEAN MITCHELL    1899 - 1986','William McLean Mitchell 002_thumb.jpg',130, 197,18,'photo_2173419.html');
												thumbnails[2173433] = new thumbnail(2173433,'145019','The main entrance which also doubled up as a display area for pictures.','Entranceway_thumb.jpg',130, 91,18,'photo_2173433.html');
												thumbnails[3940550] = new thumbnail(3940550,'239204','1929 Standard Bearers and lady bussers','1929_Standard_Bearers_thumb.jpg',130, 100,18,'photo_3940550.html');
												thumbnails[3982447] = new thumbnail(3982447,'239205','Standard Bearer Anderson leads the cavalcade up The Linglie','Heading_up_through_The_Linglie_thumb.jpg',130, 86,18,'photo_3982447.html');
												thumbnails[3982460] = new thumbnail(3982460,'239206','The procession heading \"Doon The Green\"','Doon_the_Green_thumb.jpg',130, 176,18,'photo_3982460.html');
												thumbnails[3986005] = new thumbnail(3986005,'240846','The Flute Band leads the procession','Flute_Band_leads_the_procession_thumb.jpg',130, 100,18,'photo_3986005.html');
												thumbnails[2173410] = new thumbnail(2173410,'145014','IAN WILLIAM MITCHELL    ','Ian W Mitchell 002_thumb.jpg',130, 182,18,'photo_2173410.html');
												thumbnails[2173427] = new thumbnail(2173427,'145019','Looking from behind the main camera towards the sitting area','Camera looking to sitting area2_thumb.jpg',130, 79,18,'photo_2173427.html');
												thumbnails[3940555] = new thumbnail(3940555,'239204','Members of Selkirk Silver Band at the Toll','Silver_Band_at_the_Toll_thumb.jpg',130, 114,18,'photo_3940555.html');
												thumbnails[3982450] = new thumbnail(3982450,'239205','Casting the Colours','Casting_the_Colours_thumb.jpg',130, 90,18,'photo_3982450.html');
												thumbnails[3986011] = new thumbnail(3986011,'240846','Doon The Green','Doon_the_Green1_thumb.jpg',130, 96,18,'photo_3986011.html');
												thumbnails[3986250] = new thumbnail(3986250,'239206','Standard Bearer Monks crosses the River Ettrick','Crossing_the_River_Ettrick1_thumb.jpg',130, 82,18,'photo_3986250.html');
												thumbnails[2173434] = new thumbnail(2173434,'145019','Looking back towards the main camera from the sitting area','main camera looking back_thumb.jpg',130, 87,18,'photo_2173434.html');
												thumbnails[3940558] = new thumbnail(3940558,'239204','The crowd at the Toll','Crowd_at_the_Toll_thumb.jpg',130, 94,18,'photo_3940558.html');
												thumbnails[3986012] = new thumbnail(3986012,'240846','Standard Bearer Kellet crosses the River Ettrick','Crossing_the_River_Ettrick_thumb.jpg',130, 96,18,'photo_3986012.html');
												thumbnails[3986251] = new thumbnail(3986251,'239206','Standard Bearer Monks leads the cavalcade up The Linglie','Up_the_Linglie1_thumb.jpg',130, 85,18,'photo_3986251.html');
												thumbnails[3940610] = new thumbnail(3940610,'239204','Standard Bearer Roberts comes in at the Toll','Standard_Bearer_Roberts_comes_in_at_the_Toll_thumb.jpg',130, 97,18,'photo_3940610.html');
												thumbnails[3986015] = new thumbnail(3986015,'240846','Standard Bearer Kellet leads the cavalcade up The Linglie','Up_the_Linglie_thumb.jpg',130, 82,18,'photo_3986015.html');
												thumbnails[3986289] = new thumbnail(3986289,'239206','Standard Bearer Monks casts the colours','Casting_the_Colours12_thumb.jpg',130, 162,18,'photo_3986289.html');
												thumbnails[3986019] = new thumbnail(3986019,'240846','\"safe in\" at The Toll','Safe_in_at_The_Toll_thumb.jpg',130, 120,18,'photo_3986019.html');
												thumbnails[3986290] = new thumbnail(3986290,'239206','Casting the Hammermen flag','Hammermen_thumb.jpg',130, 165,18,'photo_3986290.html');
												thumbnails[3986023] = new thumbnail(3986023,'240846','Standard Bearer Kellet casting the colours','Casting_the_Colours1_thumb.jpg',130, 89,18,'photo_3986023.html');
												thumbnails[3986291] = new thumbnail(3986291,'239206','Casting the Weavers flag','weavers_thumb.jpg',130, 171,18,'photo_3986291.html');
												thumbnails[3986311] = new thumbnail(3986311,'239206','Castin the Fleshers flag','fleshers_thumb.jpg',130, 175,18,'photo_3986311.html');
												thumbnails[3986312] = new thumbnail(3986312,'239206','Casting the Colonial flag','colonial_thumb.jpg',130, 186,18,'photo_3986312.html');
												thumbnails[3986313] = new thumbnail(3986313,'239206','Casting the Merchant Company flag','merchant_company_thumb.jpg',130, 171,18,'photo_3986313.html');
												thumbnails[3986324] = new thumbnail(3986324,'239206','The Liltin\'','the_liltin_thumb.jpg',130, 90,18,'photo_3986324.html');
												thumbnails[2173344] = new thumbnail(2173344,'145010','Hume Castle','2134_AAB0899_thumb.jpg',130, 87,18,'photo_2173344.html');
												thumbnails[2173348] = new thumbnail(2173348,'145010','','2137_AAB0903_thumb.jpg',130, 195,18,'photo_2173348.html');
												thumbnails[2173349] = new thumbnail(2173349,'145010','Hume Castle','2138_AAB0902_thumb.jpg',130, 195,18,'photo_2173349.html');
												thumbnails[2173370] = new thumbnail(2173370,'145010','Greenknowe Tower','2151_AAB0941_thumb.jpg',130, 82,18,'photo_2173370.html');
												thumbnails[2173383] = new thumbnail(2173383,'145010','Greenknowe Tower','2167_AAB0977_thumb.jpg',130, 87,18,'photo_2173383.html');
												thumbnails[2173386] = new thumbnail(2173386,'145010','Greenknowe Tower','2168_AAB0978_thumb.jpg',130, 87,18,'photo_2173386.html');
												thumbnails[2173391] = new thumbnail(2173391,'145010','Hume Castle','2172_AAB0900_thumb.jpg',130, 87,18,'photo_2173391.html');
												thumbnails[2173393] = new thumbnail(2173393,'145010','Hume Castle','2173_AAB0902_thumb.jpg',130, 196,18,'photo_2173393.html');
												thumbnails[2173403] = new thumbnail(2173403,'145010','Smailholm Tower','2218_AAB1324_thumb.jpg',130, 87,18,'photo_2173403.html');
												thumbnails[2173404] = new thumbnail(2173404,'145010','Smailholm Tower','2219_AAB1325_thumb.jpg',130, 87,18,'photo_2173404.html');
												thumbnails[2173406] = new thumbnail(2173406,'145010','Smailholm Tower','2231_AAB1359_thumb.jpg',130, 87,18,'photo_2173406.html');
												thumbnails[2173408] = new thumbnail(2173408,'145010','Smailholm Tower','2236_AAB1365-2_thumb.jpg',130, 86,18,'photo_2173408.html');
												thumbnails[2195125] = new thumbnail(2195125,'145010','360 degrees Hume Castle panorama','2244_Hume castle 360 aab857877_thumb.jpg',130, 16,18,'photo_2195125.html');
												thumbnails[2195129] = new thumbnail(2195129,'145010','','2245_Cheviots from Hume Castle_thumb.jpg',130, 20,18,'photo_2195129.html');
												thumbnails[2195132] = new thumbnail(2195132,'145010','Smailholm Tower panorama','2246_Smailholm 12621267_thumb.jpg',130, 47,18,'photo_2195132.html');
												thumbnails[2195136] = new thumbnail(2195136,'145010','Smailholm Tower 360 degree panorama','2247_smailholm aab12691280_thumb.jpg',130, 27,18,'photo_2195136.html');
												thumbnails[2195141] = new thumbnail(2195141,'145010','360 degree panorama of Smailholm Tower','2250_smailholm AAB13461357 v2_thumb.jpg',130, 24,18,'photo_2195141.html');
												thumbnails[1409258] = new thumbnail(1409258,'97930','Eildons viewed from the 3 Brethern panorama, Selkirk','0814_thumb.jpg',130, 38,18,'photo_1409258.html');
												thumbnails[1427340] = new thumbnail(1427340,'97930','Hills near Selkirk viewed from Peat Law panorama','0811_thumb.jpg',130, 21,18,'photo_1427340.html');
												thumbnails[1427348] = new thumbnail(1427348,'97930','Peat Law panorama','0817_thumb.jpg',130, 31,18,'photo_1427348.html');
												thumbnails[1427349] = new thumbnail(1427349,'97930','Lindean Reservoir','1017_thumb.jpg',130, 86,18,'photo_1427349.html');
												thumbnails[1446707] = new thumbnail(1446707,'97930','Sheep hole in dry stane dyke on the foundations of Hadrian\'s Wall','0033_thumb.jpg',130, 201,18,'photo_1446707.html');
												thumbnails[1446711] = new thumbnail(1446711,'97930','Hadrian\'s Wall','0115_thumb.jpg',130, 85,18,'photo_1446711.html');
												thumbnails[1446716] = new thumbnail(1446716,'97930','White Coomb','0498_thumb.jpg',130, 168,18,'photo_1446716.html');
												thumbnails[1446717] = new thumbnail(1446717,'97930','Loch Skene','0520_thumb.jpg',130, 62,18,'photo_1446717.html');
												thumbnails[1446719] = new thumbnail(1446719,'97930','The Railway viaduct over the River Tweed at Berwick-upon-Tweed built by Robert Stevenson','1114_thumb.jpg',130, 84,18,'photo_1446719.html');
												thumbnails[1559178] = new thumbnail(1559178,'97930','Scots Pine near the Three Brethern, Selkirk with the Eildons just visible in the background','0895_thumb.jpg',130, 76,18,'photo_1559178.html');
												thumbnails[2173313] = new thumbnail(2173313,'97930','Statue of Fletcher outside Victoria Hall in Selkirk','2117_AAB0628_thumb.jpg',130, 195,18,'photo_2173313.html');
												thumbnails[2173399] = new thumbnail(2173399,'97930','Snow covered Cheviots','2175_AAB0908_thumb.jpg',130, 183,18,'photo_2173399.html');
												thumbnails[2985712] = new thumbnail(2985712,'97930','360 degree panorama from the top of Selkirk hill','2252_Selkirk Hill tree 10731083_thumb.jpg',130, 26,18,'photo_2985712.html');
												thumbnails[5631845] = new thumbnail(5631845,'97930','Grey Mares Tail vertical panorama','3125_thumb.jpg',130, 351,18,'photo_5631845.html');
												thumbnails[5631849] = new thumbnail(5631849,'97930','Hoggs Well with Loch Skene in the background','3126_thumb.jpg',130, 49,18,'photo_5631849.html');
												thumbnails[1438993] = new thumbnail(1438993,'97932','Selkirk Common Riding Standard Bearer galloping in at the Toll','060_thumb.jpg',130, 98,18,'photo_1438993.html');
												thumbnails[1438996] = new thumbnail(1438996,'97932','Selkirk Common Riding Standard Bearer galloping in at the Toll','0258_thumb.jpg',130, 114,18,'photo_1438996.html');
												thumbnails[1439001] = new thumbnail(1439001,'97932','Selkirk Common Riding Standard Bearer Alasdair Craig at the Linglie Farm','1625DSC_6640-01_thumb.jpg',130, 196,18,'photo_1439001.html');
												thumbnails[1439003] = new thumbnail(1439003,'97932','The cavalcade following Selkirk Standard Bearer Alasdair Craig 2007','1627DSC_6649-01_thumb.jpg',130, 89,18,'photo_1439003.html');
												thumbnails[1439008] = new thumbnail(1439008,'97932','The Liltin\' Selkirk Common Riding 2007','1690Liltin pano_thumb.jpg',130, 74,18,'photo_1439008.html');
												thumbnails[1439016] = new thumbnail(1439016,'97932','False Alarm Scott\'s Selkirk 2005','Scotts Selkirk 03122005 False alarm rousing the troops again_thumb.jpg',130, 201,18,'photo_1439016.html');
												thumbnails[1439019] = new thumbnail(1439019,'97932','Walter Scott in front of one of his pieces of writing.','Scotts Selkirk 04122005 010_thumb.jpg',130, 196,18,'photo_1439019.html');
												thumbnails[1439022] = new thumbnail(1439022,'97932','Manding Kaira playing at Scott\'s Selkirk','Scotts Selkirk 04122005 West African drummer Manding Kaira_thumb.jpg',130, 196,18,'photo_1439022.html');
												thumbnails[1439023] = new thumbnail(1439023,'97932','Manding Kaira playing at Scott\'s Selkirk','Scotts Selkirk 04122005 073_thumb.jpg',130, 196,18,'photo_1439023.html');
												thumbnails[1409140] = new thumbnail(1409140,'98959','The Cuillins mountain range on Skye, Scotland','0651_thumb.jpg',130, 79,18,'photo_1409140.html');
												thumbnails[1439063] = new thumbnail(1439063,'98959','View of Marsco from Glen Sligachan, The Cuillins, Skye','0605_thumb.jpg',130, 88,18,'photo_1439063.html');
												thumbnails[1446710] = new thumbnail(1446710,'98959','Loch Etive, just off the Great Glen','0062_thumb.jpg',130, 198,18,'photo_1446710.html');
												thumbnails[1446718] = new thumbnail(1446718,'98959','The Cuillins','1019_thumb.jpg',130, 62,18,'photo_1446718.html');
												thumbnails[1446731] = new thumbnail(1446731,'98959','Loch Coruisk with the Cuillins in the background','0136_thumb.jpg',130, 170,18,'photo_1446731.html');
												thumbnails[1446734] = new thumbnail(1446734,'98959','Southern Upland Way route marker','0865_thumb.jpg',130, 85,18,'photo_1446734.html');
												thumbnails[1426990] = new thumbnail(1426990,'97933','Infra red hawthorn tree','0061_thumb.jpg',130, 81,18,'photo_1426990.html');
												thumbnails[1426994] = new thumbnail(1426994,'97933','European larch cones','0410_thumb.jpg',130, 204,18,'photo_1426994.html');
												thumbnails[1427003] = new thumbnail(1427003,'97933','Hawthorn tree','1000_thumb.jpg',130, 94,18,'photo_1427003.html');
												thumbnails[1427007] = new thumbnail(1427007,'97933','Backlit hawthorn tree','1009_thumb.jpg',130, 65,18,'photo_1427007.html');
												thumbnails[1427040] = new thumbnail(1427040,'97933','Misty morning at Harestanes near Kelso','1117_thumb.1.jpg',130, 84,18,'photo_1427040.html');
												thumbnails[1446654] = new thumbnail(1446654,'97933','Trees reflected in Yorkshire stream','0015_thumb.jpg',130, 198,18,'photo_1446654.html');
												thumbnails[1559182] = new thumbnail(1559182,'97933','Bare trees on field edge','1523DSC_6005-01_thumb.jpg',130, 81,18,'photo_1559182.html');
												thumbnails[1559190] = new thumbnail(1559190,'97933','Trees on field edge','1466_thumb.jpg',130, 85,18,'photo_1559190.html');
												thumbnails[1559197] = new thumbnail(1559197,'97933','Surise through oak tree','1508DSC_5956-01_thumb.jpg',130, 86,18,'photo_1559197.html');
												thumbnails[1559206] = new thumbnail(1559206,'97933','Trees on field edge','1522DSC_6004-01_thumb.jpg',130, 58,18,'photo_1559206.html');
												thumbnails[2132192] = new thumbnail(2132192,'97933','Pre-dawn Winter tree','1865_AAA9133_thumb.jpg',130, 86,18,'photo_2132192.html');
												thumbnails[2173305] = new thumbnail(2173305,'97933','Reflection and ripples','2040_AAA9645_thumb.jpg',130, 87,18,'photo_2173305.html');
												thumbnails[2985707] = new thumbnail(2985707,'97933','Rowan tree and dry stane dyke, Selkirk Hill','2192_AAB1069-2_thumb.jpg',130, 196,18,'photo_2985707.html');
												thumbnails[2985709] = new thumbnail(2985709,'97933','Rowan tree, Selkirk Hill','2197_AAB10961_thumb.jpg',130, 69,18,'photo_2985709.html');
												thumbnails[3642716] = new thumbnail(3642716,'97933','Misty morning trees, Suffolk','2673_AAB3729_thumb.jpg',130, 86,18,'photo_3642716.html');
												thumbnails[3642723] = new thumbnail(3642723,'97933','Autumnal Maple and Oak tree','2761_AAB4253_thumb.jpg',130, 86,18,'photo_3642723.html');
												thumbnails[3642729] = new thumbnail(3642729,'97933','Frost covered trees, Suffolk','2771_AAB4444_thumb.jpg',130, 100,18,'photo_3642729.html');
												thumbnails[3642735] = new thumbnail(3642735,'97933','Sunrise behind trees, Suffolk','2784-_AAB4762_thumb.jpg',130, 86,18,'photo_3642735.html');
												thumbnails[1426960] = new thumbnail(1426960,'97931','Red fox (vulpes vulpes)','1011_thumb.jpg',130, 194,18,'photo_1426960.html');
												thumbnails[1426962] = new thumbnail(1426962,'97931','Gray Wolf (canis lupus)','0046_thumb.jpg',130, 91,18,'photo_1426962.html');
												thumbnails[1427070] = new thumbnail(1427070,'97931','Backlit brown hare at dawn','1752DSC_7240-01_thumb.jpg',130, 86,18,'photo_1427070.html');
												thumbnails[1427154] = new thumbnail(1427154,'97931','Scottish Wildcat','1014_thumb.jpg',130, 85,18,'photo_1427154.html');
												thumbnails[1427313] = new thumbnail(1427313,'97931','Feral goat amongst the heather looking towards the Grey Mare\'s Tail','1161_thumb.jpg',130, 86,18,'photo_1427313.html');
												thumbnails[1427320] = new thumbnail(1427320,'97931','Feral goat amongst the heather.','1170_thumb.jpg',130, 90,18,'photo_1427320.html');
												thumbnails[1439098] = new thumbnail(1439098,'97931','Backlit gull with waves behind','0030_thumb.jpg',130, 189,18,'photo_1439098.html');
												thumbnails[1439115] = new thumbnail(1439115,'98960','Northern Marsh orchids amongst Mares Tail','0163_thumb.jpg',130, 195,18,'photo_1439115.html');
												thumbnails[1439122] = new thumbnail(1439122,'98960','Dandelions','0819_thumb.jpg',130, 87,18,'photo_1439122.html');
												thumbnails[1439125] = new thumbnail(1439125,'98960','Water Avens','0983_thumb.jpg',130, 196,18,'photo_1439125.html');
												thumbnails[1439127] = new thumbnail(1439127,'98960','Poppy','1004 new_thumb.jpg',130, 86,18,'photo_1439127.html');
												thumbnails[1446674] = new thumbnail(1446674,'98960','Snowflake encrusted plant','0016_thumb.jpg',130, 206,18,'photo_1446674.html');
												thumbnails[1446683] = new thumbnail(1446683,'98960','Harebell','0123_thumb.jpg',130, 197,18,'photo_1446683.html');
												thumbnails[1446692] = new thumbnail(1446692,'98960','Cotton grass','0158_thumb.jpg',130, 201,18,'photo_1446692.html');
												thumbnails[1446732] = new thumbnail(1446732,'98960','Bluebells and ferns','0162_thumb.jpg',130, 198,18,'photo_1446732.html');
												thumbnails[2985715] = new thumbnail(2985715,'98960','Pyramidal Orchids','2328 plant recognition and pond dipping 280608_thumb.jpg',130, 196,18,'photo_2985715.html');
												thumbnails[2985717] = new thumbnail(2985717,'97931','Harris Hawk','2450_AAB1718_thumb.jpg',130, 86,18,'photo_2985717.html');
												thumbnails[3642738] = new thumbnail(3642738,'97931','Brown hare in snow form','2790_AAB4736_thumb.jpg',130, 86,18,'photo_3642738.html');
												thumbnails[3642744] = new thumbnail(3642744,'97931','Brown hare','2862_AAB5514_thumb.jpg',130, 86,18,'photo_3642744.html');
												thumbnails[5296552] = new thumbnail(5296552,'97931','Fox','2916_thumb.jpg',130, 86,18,'photo_5296552.html');
												thumbnails[5296555] = new thumbnail(5296555,'97931','Little owl','2948_thumb.jpg',130, 105,18,'photo_5296555.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[97930] = new gallery(97930,'5631849,5631845,1427348,1427340,1409258','Border landscapes','section130968',[1409258,1427340,1427348,1427349,1446707,1446711,1446716,1446717,1446719,1559178,2173313,2173399,2985712,5631845,5631849],0, 0, '', 'section130968.html',0,1);
				  					galleries[425844] = new gallery(425844,'7896620,7896617,7896613,7896609,7896607,7896604,7896598,7896597,7896596,7896593','Images for display at Bowhill','section132697',[7896561,7896565,7896568,7896570,7896573,7896575,7896577,7896581,7896582,7896586,7896590,7896593,7896596,7896597,7896598,7896604,7896607,7896609,7896613,7896617,7896620],0, 0, '', 'section132697_425844.html',0,0);
				  					galleries[98960] = new gallery(98960,'2985715,1446732,1446692,1446683,1446674,1439127,1439125,1439122,1439115','Plants and Flowers','section132563',[1439115,1439122,1439125,1439127,1446674,1446683,1446692,1446732,2985715],0, 0, '', 'section132563.html',0,1);
				  					galleries[98959] = new gallery(98959,'1446734,1446731,1446718,1446710,1439063,1409140','Scotland','section132564',[1409140,1439063,1446710,1446718,1446731,1446734],0, 0, '', 'section132564.html',0,1);
				  					galleries[97932] = new gallery(97932,'1439023,1439022,1439019,1439016,1439008,1439003,1439001,1438996,1438993','Selkirk Common Riding','section130977',[1438993,1438996,1439001,1439003,1439008,1439016,1439019,1439022,1439023],0, 0, '', 'section130977.html',0,1);
				  					galleries[97933] = new gallery(97933,'3642735,3642729,3642723,3642716,2985709,2985707,2173305,2132192,1559206,1559197','Trees','section130975',[1426990,1426994,1427003,1427007,1427040,1446654,1559182,1559190,1559197,1559206,2132192,2173305,2985707,2985709,3642716,3642723,3642729,3642735],0, 0, '', 'section130975.html',0,1);
				  					galleries[97931] = new gallery(97931,'5296555,5296552,3642744,1439098,1427320,1427313,1427154,1427070','Wildlife','section130976',[1426960,1426962,1427070,1427154,1427313,1427320,1439098,2985717,3642738,3642744,5296552,5296555],0, 0, '', 'section130976.html',0,1);
				  					galleries[145014] = new gallery(145014,'2173423,2173419,2173412,2173410','Biographies','section132697',[2173412,2173423,2173419,2173410],0, 0, '145013', 'section132697_145014.html',0,0);
				  					galleries[145019] = new gallery(145019,'2173441,2173437,2173434,2173433,2173427','The Studio','section132697',[2173437,2173441,2173433,2173427,2173434],0, 0, '145013', 'section132697_145019.html',0,0);
				  					galleries[145013] = new gallery(145013,'2245541,2245539,2245537,2245534,2245531,2245530,2245526,2245525,2245524,2245521','The R. Clapperton Studio','section132697',[],0, 0, '', 'section132697_145013.html',0,0);
				  					galleries[239203] = new gallery(239203,'3950295,3950293','Selkirk Common Riding - 1899','section132697',[3950293,3950295],0, 0, '', 'section132697_239203.html',0,0);
				  					galleries[145010] = new gallery(145010,'2195141,2195136,2195132,2195129,2195125,2173408,2173406,2173404,2173403,2173393','Border Towers and castles','section186431',[2173344,2173348,2173349,2173370,2173383,2173386,2173391,2173393,2173403,2173404,2173406,2173408,2195125,2195129,2195132,2195136,2195141],0, 0, '', 'section186431.html',0,1);
				  					galleries[239204] = new gallery(239204,'3940610,3940558,3940555,3940550,3940547,3940505','Selkirk Common Riding - 1929','section132697',[3940505,3940547,3940550,3940555,3940558,3940610],0, 0, '', 'section132697_239204.html',0,0);
				  					galleries[98962] = new gallery(98962,'1446721,1446720,1439080,1439077','Archive pictures','section132697',[1439077,1439080,1446720,1446721],0, 0, '145013', 'section132697_98962.html',0,0);
				  					galleries[239205] = new gallery(239205,'3982450,3982447,3982444,3982442','Selkirk Common Riding - 1949','section132697',[3982442,3982444,3982447,3982450],0, 0, '', 'section132697_239205.html',0,0);
				  					galleries[240846] = new gallery(240846,'3986023,3986019,3986015,3986012,3986011,3986005,3986001,3985999','Selkirk Common Riding - 1959','section132697',[3985999,3986001,3986005,3986011,3986012,3986015,3986019,3986023],0, 0, '', 'section132697_240846.html',0,0);
				  					galleries[239206] = new gallery(239206,'3986324,3986313,3986312,3986311,3986291,3986290,3986289,3986251,3986250,3982464','Selkirk Common Riding - 1984','section132697',[3982455,3982464,3982460,3986250,3986251,3986289,3986290,3986291,3986311,3986312,3986313,3986324],0, 0, '', 'section132697_239206.html',0,0);
				  					galleries[147757] = new gallery(147757,'2245531,2245524,2245518,2245517,2245516,2245515,2245514,2245513,2245512,2245510','Farming in the Borders','section132697',[2245510,2245512,2245513,2245514,2245515,2245516,2245517,2245518,2245524,2245531],0, 0, '145013', 'section132697_147757.html',0,0);
				  					galleries[147758] = new gallery(147758,'2245541,2245539,2245537,2245534,2245530,2245526,2245525,2245521','Trains in the Borders','section132697',[2245521,2245525,2245526,2245530,2245534,2245537,2245539,2245541],0, 0, '145013', 'section132697_147758.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '5631849,5631845,5296555,5296552,3642738,3642735,3642729,3642723,3642716,2985707,2195125,2173344,2132192,1446734,1446732,1446719,1446718,1446707,1446692,1446674,1439125,1439122,1439115,1439098,1439063,1439023,1439016,1439003,1438993,1427348,1427340,1427320,1427313,1427070,1427007,1427003,1426960,1409258,1409140';
imageSets[2] = '5631849,5631845,5296555,5296552,3642744,1439098,1427348,1427340,1427320,1427313,1427154,1427070,1409258';
imageSets[3] = '5631849,5631845,5296555,5296552,1439098';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/derekmitchell/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/derekmitchell/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 += 'section132697.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 && 'section132697' != '') {
					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 = 'Scottish Border Camera: ' + 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 Google Checkout:</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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		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">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="DEREKMITCHELL">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = temp + '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
	temp = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			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;
	}
}

			

