window.thumbnails = {};
															thumbnails[5434970] = clik.newPhoto({"id":5434970,"src":"photographer_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"The photographer at work.","height":184});
															thumbnails[8555645] = clik.newPhoto({"id":8555645,"src":"Colorado_summer_2011_DSCN0265_40_thumb.jpg","galleries_id":266393,"server_id":35,"link":"photo_8555645.html","width":130,"caption":"Summer colour","height":182});
															thumbnails[8555515] = clik.newPhoto({"id":8555515,"src":"Colorado_summer_2011_DSCN0265_11_thumb.jpg","galleries_id":266393,"server_id":35,"link":"photo_8555515.html","width":130,"caption":"Rodeo","height":93});
															thumbnails[8555643] = clik.newPhoto({"id":8555643,"src":"Colorado_summer_2011_DSCN0265_12_thumb.jpg","galleries_id":266393,"server_id":35,"link":"photo_8555643.html","width":130,"caption":"Rodeo 2","height":63});
															thumbnails[8555453] = clik.newPhoto({"id":8555453,"src":"Colorado_summer_2011_DSCN0265_7_thumb.jpg","galleries_id":266393,"server_id":35,"link":"photo_8555453.html","width":130,"caption":"Patriotic ballooning","height":182});
															thumbnails[8555494] = clik.newPhoto({"id":8555494,"src":"Colorado_summer_2011_DSCN0265_9_thumb.jpg","galleries_id":266393,"server_id":35,"link":"photo_8555494.html","width":130,"caption":"Colour","height":93});
															thumbnails[8555448] = clik.newPhoto({"id":8555448,"src":"Colorado_summer_2011_DSCN0265_2_thumb.jpg","galleries_id":266393,"server_id":35,"link":"photo_8555448.html","width":130,"caption":"Grille","height":173});
															thumbnails[7181342] = clik.newPhoto({"id":7181342,"src":"Islay_2010_14_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_7181342.html","width":130,"caption":"Gruinart Bay 1","height":56});
															thumbnails[7181505] = clik.newPhoto({"id":7181505,"src":"Islay_2010_15_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_7181505.html","width":130,"caption":"Gruinart Bay 2","height":62});
															thumbnails[7181515] = clik.newPhoto({"id":7181515,"src":"Islay_2010_17_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_7181515.html","width":130,"caption":"Lobster pot.","height":69});
															thumbnails[7181529] = clik.newPhoto({"id":7181529,"src":"Islay_2010_26_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_7181529.html","width":130,"caption":"Fallow","height":182});
															thumbnails[6390039] = clik.newPhoto({"id":6390039,"src":"ganet_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_6390039.html","width":130,"caption":"Gannet","height":93});
															thumbnails[6346870] = clik.newPhoto({"id":6346870,"src":"grouse_and_chick_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_6346870.html","width":130,"caption":"Red Grouse and chick","height":93});
															thumbnails[6346896] = clik.newPhoto({"id":6346896,"src":"bog_cotton1_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_6346896.html","width":130,"caption":"Bog Cotton","height":70});
															thumbnails[6346914] = clik.newPhoto({"id":6346914,"src":"puffin_and_sea_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_6346914.html","width":130,"caption":"Puffin on cliff","height":93});
															thumbnails[6346954] = clik.newPhoto({"id":6346954,"src":"skua_landing_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_6346954.html","width":130,"caption":"Arctic Skua","height":93});
															thumbnails[6347008] = clik.newPhoto({"id":6347008,"src":"Kinlochewe_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_6347008.html","width":130,"caption":"Kylesku","height":76});
															thumbnails[6347015] = clik.newPhoto({"id":6347015,"src":"scourie_sunset_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_6347015.html","width":130,"caption":"Scourie sunset","height":63});
															thumbnails[6346990] = clik.newPhoto({"id":6346990,"src":"whisky_barrels_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_6346990.html","width":130,"caption":"Whisky barrels","height":87});
															thumbnails[6346976] = clik.newPhoto({"id":6346976,"src":"Ringed_plover_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_6346976.html","width":130,"caption":"Ringed Plover","height":93});
															thumbnails[4363927] = clik.newPhoto({"id":4363927,"src":"Baobabs_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4363927.html","width":130,"caption":"Sundown Baobabs, Madagascar","height":87});
															thumbnails[4363989] = clik.newPhoto({"id":4363989,"src":"Boys_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4363989.html","width":130,"caption":"Planning","height":181});
															thumbnails[4363906] = clik.newPhoto({"id":4363906,"src":"prayerflags_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4363906.html","width":130,"caption":"Prayer Flags, SW China","height":87});
															thumbnails[4363962] = clik.newPhoto({"id":4363962,"src":"BlueFootedBoobies_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4363962.html","width":130,"caption":"Blue Footed Boobie","height":196});
															thumbnails[4363973] = clik.newPhoto({"id":4363973,"src":"BlueFootedBoobiespair_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4363973.html","width":130,"caption":"Blue Footed Boobies","height":90});
															thumbnails[4364042] = clik.newPhoto({"id":4364042,"src":"butterflydali_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4364042.html","width":130,"caption":"Lime butterfly, South West China","height":87});
															thumbnails[4406759] = clik.newPhoto({"id":4406759,"src":"Grouse2_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4406759.html","width":130,"caption":"Red Grouse","height":93});
															thumbnails[4406761] = clik.newPhoto({"id":4406761,"src":"Juvenileorungutanborneo_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4406761.html","width":130,"caption":"Orangutan","height":182});
															thumbnails[4406885] = clik.newPhoto({"id":4406885,"src":"lagganat_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4406885.html","width":130,"caption":"Space","height":93});
															thumbnails[4406893] = clik.newPhoto({"id":4406893,"src":"lagganat2_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4406893.html","width":130,"caption":"Single track","height":182});
															thumbnails[4406931] = clik.newPhoto({"id":4406931,"src":"Mcleodschurchlscape_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4406931.html","width":130,"caption":"Place of rest","height":93});
															thumbnails[4411532] = clik.newPhoto({"id":4411532,"src":"oldwomendali_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4411532.html","width":130,"caption":"Market day","height":194});
															thumbnails[4411536] = clik.newPhoto({"id":4411536,"src":"orangutanborneo_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4411536.html","width":130,"caption":"Orangutan","height":196});
															thumbnails[4411541] = clik.newPhoto({"id":4411541,"src":"Ptarmigan_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4411541.html","width":130,"caption":"Ptarmigan, summer plumage","height":93});
															thumbnails[4411543] = clik.newPhoto({"id":4411543,"src":"puffinhead_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4411543.html","width":130,"caption":"Puffin, Head and beak","height":87});
															thumbnails[4411545] = clik.newPhoto({"id":4411545,"src":"puffinheadshoulders_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4411545.html","width":130,"caption":"Puffin, Head and shoulders","height":93});
															thumbnails[4411546] = clik.newPhoto({"id":4411546,"src":"puffinstanding_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4411546.html","width":130,"caption":"Puffin, Portrait","height":194});
															thumbnails[4411562] = clik.newPhoto({"id":4411562,"src":"Snipe_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4411562.html","width":130,"caption":"Snipe","height":87});
															thumbnails[4411618] = clik.newPhoto({"id":4411618,"src":"tractorlijiang_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4411618.html","width":130,"caption":"In from the fields","height":93});
															thumbnails[4411626] = clik.newPhoto({"id":4411626,"src":"Ullapool_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4411626.html","width":130,"caption":"Misty Isle","height":64});
															thumbnails[4411640] = clik.newPhoto({"id":4411640,"src":"Viewfromanteallach_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4411640.html","width":130,"caption":"The Highlands","height":173});
															thumbnails[4411642] = clik.newPhoto({"id":4411642,"src":"WeddingportraitAG_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4411642.html","width":130,"caption":"The Bride","height":182});
															thumbnails[4411685] = clik.newPhoto({"id":4411685,"src":"womenwithboylijiang_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4411685.html","width":130,"caption":"Old and young","height":87});
															thumbnails[4504298] = clik.newPhoto({"id":4504298,"src":"a_face_in_the_crowd_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4504298.html","width":130,"caption":"A face in the crowd","height":93});
															thumbnails[4504307] = clik.newPhoto({"id":4504307,"src":"a_place_in_the_shade_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4504307.html","width":130,"caption":"A place in the shade","height":182});
															thumbnails[4504312] = clik.newPhoto({"id":4504312,"src":"Black_Heron_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4504312.html","width":130,"caption":"Humblot's Heron Ardea humbloti","height":93});
															thumbnails[4504333] = clik.newPhoto({"id":4504333,"src":"chopping_wood_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4504333.html","width":130,"caption":"Cutting firewood","height":93});
															thumbnails[4504338] = clik.newPhoto({"id":4504338,"src":"Clapping_girl_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4504338.html","width":130,"caption":"Happy clapping","height":182});
															thumbnails[4504353] = clik.newPhoto({"id":4504353,"src":"Findlatter_castle_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4504353.html","width":130,"caption":"The ruins","height":182});
															thumbnails[4504357] = clik.newPhoto({"id":4504357,"src":"Fish_eagle_wm1_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4504357.html","width":130,"caption":"Yellow billed Kite","height":93});
															thumbnails[4504365] = clik.newPhoto({"id":4504365,"src":"fishing_girls_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4504365.html","width":130,"caption":"Fisher Girls","height":87});
															thumbnails[4504371] = clik.newPhoto({"id":4504371,"src":"Mangroves_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4504371.html","width":130,"caption":"Mangroves","height":194});
															thumbnails[4504378] = clik.newPhoto({"id":4504378,"src":"pure_sunset_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4504378.html","width":130,"caption":"Pure Sunset","height":70});
															thumbnails[4504381] = clik.newPhoto({"id":4504381,"src":"river_view_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4504381.html","width":130,"caption":"The Manambolo","height":67});
															thumbnails[4504385] = clik.newPhoto({"id":4504385,"src":"Sifaka_Lemur_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4504385.html","width":130,"caption":"Sifaka","height":182});
															thumbnails[4504407] = clik.newPhoto({"id":4504407,"src":"three_dug_outs_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4504407.html","width":130,"caption":"The Piroguieurs","height":63});
															thumbnails[4504414] = clik.newPhoto({"id":4504414,"src":"Women_under_umbrellas_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4504414.html","width":130,"caption":"In the shade","height":93});
															thumbnails[4528771] = clik.newPhoto({"id":4528771,"src":"Cloth_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4528771.html","width":130,"caption":"Cloth","height":83});
															thumbnails[4529037] = clik.newPhoto({"id":4529037,"src":"Dancing_girl_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4529037.html","width":130,"caption":"Girl in the ring","height":194});
															thumbnails[4529093] = clik.newPhoto({"id":4529093,"src":"dhow_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4529093.html","width":130,"caption":"Dhow","height":93});
															thumbnails[4529101] = clik.newPhoto({"id":4529101,"src":"Fishing_net_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4529101.html","width":130,"caption":"The throw","height":93});
															thumbnails[4529230] = clik.newPhoto({"id":4529230,"src":"Laggan_East_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4529230.html","width":130,"caption":"Loch Laggan","height":71});
															thumbnails[4529256] = clik.newPhoto({"id":4529256,"src":"Mouse_Lemur_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4529256.html","width":130,"caption":"Mouse Lemur","height":182});
															thumbnails[4529354] = clik.newPhoto({"id":4529354,"src":"Sailing_dhow_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4529354.html","width":130,"caption":"Sailing Dhow","height":87});
															thumbnails[4529530] = clik.newPhoto({"id":4529530,"src":"Stones_watercolour_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4529530.html","width":130,"caption":"Sea stones","height":87});
															thumbnails[4566100] = clik.newPhoto({"id":4566100,"src":"Chillies_Puglia_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4566100.html","width":130,"caption":"Red Chillies","height":88});
															thumbnails[4566160] = clik.newPhoto({"id":4566160,"src":"downed_helo_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4566160.html","width":130,"caption":"Stuck in a storm","height":86});
															thumbnails[4566175] = clik.newPhoto({"id":4566175,"src":"puglia_roofs_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4566175.html","width":130,"caption":"Trio","height":196});
															thumbnails[4566187] = clik.newPhoto({"id":4566187,"src":"snow_monkey_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4566187.html","width":130,"caption":"Snow Monkey","height":87});
															thumbnails[4566194] = clik.newPhoto({"id":4566194,"src":"Snowy_owl_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4566194.html","width":130,"caption":"Snowy Owl","height":194});
															thumbnails[4707683] = clik.newPhoto({"id":4707683,"src":"eyes_wm1_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4707683.html","width":130,"caption":"Eyes","height":97});
															thumbnails[4707691] = clik.newPhoto({"id":4707691,"src":"festival_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4707691.html","width":130,"caption":"The EICC","height":196});
															thumbnails[4707703] = clik.newPhoto({"id":4707703,"src":"fringe_tout_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4707703.html","width":130,"caption":"Grabbit","height":121});
															thumbnails[4756786] = clik.newPhoto({"id":4756786,"src":"Gentian_cluster_wm12_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4756786.html","width":130,"caption":"Gentian group","height":171});
															thumbnails[4805750] = clik.newPhoto({"id":4805750,"src":"Kite_yellow_billed_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4805750.html","width":130,"caption":"Yellow Billed Kite, Milvus aegyptius","height":93});
															thumbnails[4969150] = clik.newPhoto({"id":4969150,"src":"bow_bandw_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4969150.html","width":130,"caption":"Bow Fiddle rock","height":80});
															thumbnails[4969158] = clik.newPhoto({"id":4969158,"src":"Bow_fiddle_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4969158.html","width":130,"caption":"Bow Fiddle rock","height":191});
															thumbnails[4969168] = clik.newPhoto({"id":4969168,"src":"pearly_queen_wm_thumb.jpg","galleries_id":258453,"server_id":18,"link":"photo_4969168.html","width":130,"caption":"The Pearly Queen","height":201});
															thumbnails[4969178] = clik.newPhoto({"id":4969178,"src":"pityoulish_lscape_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4969178.html","width":130,"caption":"Autumn trees","height":88});
															thumbnails[4969180] = clik.newPhoto({"id":4969180,"src":"pityoulish_trees_lscape_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4969180.html","width":130,"caption":"Lone tree","height":65});
															thumbnails[4969186] = clik.newPhoto({"id":4969186,"src":"pityoulish_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4969186.html","width":130,"caption":"Early morning mist","height":86});
															thumbnails[4969196] = clik.newPhoto({"id":4969196,"src":"seaweed_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4969196.html","width":130,"caption":"Seaweed","height":95});
															thumbnails[4969319] = clik.newPhoto({"id":4969319,"src":"bible_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4969319.html","width":130,"caption":"All that is left is faith","height":88});
															thumbnails[4969344] = clik.newPhoto({"id":4969344,"src":"Callanais_2_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4969344.html","width":130,"caption":"Calanais standing stones, site 2","height":83});
															thumbnails[4969347] = clik.newPhoto({"id":4969347,"src":"Callanais_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4969347.html","width":130,"caption":"Calanais","height":87});
															thumbnails[4969514] = clik.newPhoto({"id":4969514,"src":"departed_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4969514.html","width":130,"caption":"Departed","height":196});
															thumbnails[4969642] = clik.newPhoto({"id":4969642,"src":"door_lock_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4969642.html","width":130,"caption":"Blue door","height":186});
															thumbnails[4969645] = clik.newPhoto({"id":4969645,"src":"Highland_cow_wm_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_4969645.html","width":130,"caption":"Highland Cow","height":188});
															thumbnails[4969653] = clik.newPhoto({"id":4969653,"src":"Luskentyre_beach_wm_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_4969653.html","width":130,"caption":"Luskentyre Beach","height":60});
															thumbnails[4969657] = clik.newPhoto({"id":4969657,"src":"cow_and_calf_bw_wm_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_4969657.html","width":130,"caption":"Highland cow and calf","height":96});
															thumbnails[5079933] = clik.newPhoto({"id":5079933,"src":"red_rose1_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_5079933.html","width":130,"caption":"Red Rose","height":124});
															thumbnails[5270799] = clik.newPhoto({"id":5270799,"src":"Bostadh_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_5270799.html","width":130,"caption":"Bostadh Bay","height":74});
															thumbnails[5270800] = clik.newPhoto({"id":5270800,"src":"Bostadh2_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_5270800.html","width":130,"caption":"Bostadh Bay","height":70});
															thumbnails[5270801] = clik.newPhoto({"id":5270801,"src":"Frost_thumb.jpg","galleries_id":258450,"server_id":18,"link":"photo_5270801.html","width":130,"caption":"Frost","height":182});
															thumbnails[5270803] = clik.newPhoto({"id":5270803,"src":"Green_field_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_5270803.html","width":130,"caption":"Green Field","height":67});
															thumbnails[5270811] = clik.newPhoto({"id":5270811,"src":"Hare_running_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_5270811.html","width":130,"caption":"Hare running","height":93});
															thumbnails[5270815] = clik.newPhoto({"id":5270815,"src":"Mountain_Hare_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_5270815.html","width":130,"caption":"Mountain hare","height":93});
															thumbnails[5270818] = clik.newPhoto({"id":5270818,"src":"Valasy_peninsular_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_5270818.html","width":130,"caption":"Valasay peninsular","height":71});
															thumbnails[5423271] = clik.newPhoto({"id":5423271,"src":"Mule_deer_thumb.jpg","galleries_id":256329,"server_id":18,"link":"photo_5423271.html","width":130,"caption":"Mule Deer","height":93});
															thumbnails[5423274] = clik.newPhoto({"id":5423274,"src":"Spring_river_thumb.jpg","galleries_id":256330,"server_id":18,"link":"photo_5423274.html","width":130,"caption":"Spring river","height":74});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[258450] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Abstract","link":"gallery_258450.html","maxRecords":0.0,"photoIDs":[6346990.0,4363906.0,4528771.0,4529530.0,4566100.0,4566160.0,4566175.0,4707691.0,4756786.0,4969196.0,4969319.0,4969514.0,4969642.0,4969645.0,5079933.0,5270801.0],"skipIndex":0,"section_code":"gallery","featured_images":"6346990,5270801,5079933,4969645,4969642,4969514,4969319,4969196,4756786,4707691","id":258450,"singleSection":false});				  						galleries[258453] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"People","link":"gallery_258453.html","maxRecords":0.0,"photoIDs":[4363989.0,4406885.0,4406893.0,4411532.0,4411618.0,4411642.0,4411685.0,4504298.0,4504333.0,4504338.0,4504365.0,4504407.0,4504414.0,4529037.0,4529101.0,4707683.0,4707703.0,4969168.0],"skipIndex":0,"section_code":"gallery","featured_images":"4969168,4707703,4707683,4529101,4529037,4504414,4504407,4504365,4504338,4504333","id":258453,"singleSection":false});				  						galleries[256329] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife","link":"gallery_256329.html","maxRecords":0.0,"photoIDs":[7181529.0,6390039.0,6346870.0,6346914.0,6346954.0,6346976.0,4363962.0,4363973.0,4364042.0,4406759.0,4406761.0,4411536.0,4411541.0,4411543.0,4411545.0,4411546.0,4411562.0,4504312.0,4504357.0,4504385.0,4529256.0,4566187.0,4566194.0,4805750.0,4969657.0,5270811.0,5270815.0,5423271.0],"skipIndex":0,"section_code":"gallery","featured_images":"7181529,6390039,6346976,6346954,6346914,6346870,5423271,5270815,5270811,4969657","id":256329,"singleSection":false});				  						galleries[256330] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_256330.html","maxRecords":0.0,"photoIDs":[7181342.0,7181505.0,7181515.0,6346896.0,6347008.0,6347015.0,4363927.0,4406931.0,4411626.0,4411640.0,4504307.0,4504353.0,4504371.0,4504378.0,4504381.0,4529093.0,4529230.0,4529354.0,4969150.0,4969158.0,4969178.0,4969180.0,4969186.0,4969344.0,4969347.0,4969653.0,5270799.0,5270800.0,5270803.0,5270818.0,5423274.0],"skipIndex":0,"section_code":"gallery","featured_images":"7181515,7181505,7181342,6347015,6347008,6346896,5423274,5270818,5270803,5270800","id":256330,"singleSection":false});				  						galleries[266393] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"New images","link":"gallery_266393.html","maxRecords":0.0,"photoIDs":[8555645.0,8555515.0,8555643.0,8555453.0,8555494.0,8555448.0],"skipIndex":0,"section_code":"gallery","featured_images":"8555645,8555643,8555515,8555494,8555453,8555448","id":266393,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[231665] = '8555645,8555494,6346990,6346896,5270801,5079933,4969642,4969196,4756786,4707703,4707691,4566175,4566160,4566100,4529530,4528771,4411626';
imageSets[1] = '8555515';
imageSets[231651] = '8555645,8555643,8555515,8555453,7181515,7181505,7181342,6347015,6347008,5423274,5270818,5270803,5270800,5270799,4969653,4969186,4969180,4969178,4969150,4805750,4707683,4566175,4566100,4529354,4529230,4529101,4529093,4529037,4528771,4504414,4504407,4504385,4504381,4504378,4504371,4504365,4504357,4504353,4504338,4504333,4504312,4504307,4504298,4411685,4411640,4411626,4411618,4411536,4411532,4406931,4406893,4406885,4406761,4364042,4363989,4363973,4363962,4363927,4363906';
imageSets[3] = '4969196,4969186,4969180,4969178,4969168,4969150';
imageSets[231652] = '8555643,8555515,4969514,4969168,4707703,4707683,4529101,4529037,4504414,4504407,4504365,4504338,4504333,4504298,4411685,4411642,4411618,4411532,4406893,4406885,4363989';
imageSets[231666] = '8555645,7181529,6346976,6346954,6346914,6346896,6346870,5423271,5270815,5270811,4969657,4969645,4969158,4805750,4756786,4566194,4566187,4529256,4504385,4504357,4504312,4411562,4411546,4411545,4411543,4411541,4411536,4406761,4406759,4364042,4363973,4363962';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/martinsearle/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/martinsearle/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 = 'MTS 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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp += '<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;
	}
}

			

