window.thumbnails = {};
															thumbnails[4434838] = clik.newPhoto({"id":4434838,"src":"Logo13_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":37});
															thumbnails[3033591] = clik.newPhoto({"id":3033591,"src":"HH Reserve 30-10-200807_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3033591.html","width":109,"caption":"Fairy Dust","height":130});
															thumbnails[3325710] = clik.newPhoto({"id":3325710,"src":"Steenbrasdam1 10_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3325710.html","width":87,"caption":"Over the rainbow","height":130});
															thumbnails[3325711] = clik.newPhoto({"id":3325711,"src":"Steenbrasdam1 11_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3325711.html","width":87,"caption":"Steenbras Dam","height":130});
															thumbnails[3360441] = clik.newPhoto({"id":3360441,"src":"DSC_006400012_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3360441.html","width":87,"caption":"Sewejaartjies","height":130});
															thumbnails[3398909] = clik.newPhoto({"id":3398909,"src":"DSC_00932009-02-03_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3398909.html","width":87,"caption":"Purple Night","height":130});
															thumbnails[3467074] = clik.newPhoto({"id":3467074,"src":"DSC_00772009-02-17_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3467074.html","width":87,"caption":"Perfect Evening series","height":130});
															thumbnails[3471431] = clik.newPhoto({"id":3471431,"src":"DSC_01002009-02-17_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3471431.html","width":99,"caption":"Perfect Evening series","height":130});
															thumbnails[3472295] = clik.newPhoto({"id":3472295,"src":"DSC_00332009-02-17_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3472295.html","width":91,"caption":"Layered Cake","height":130});
															thumbnails[3498948] = clik.newPhoto({"id":3498948,"src":"DSC_0043 2009-02-24_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3498948.html","width":87,"caption":"Fallen Elders","height":130});
															thumbnails[3534798] = clik.newPhoto({"id":3534798,"src":"DSC_0001_2009-02-24_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3534798.html","width":87,"caption":"Firerods","height":130});
															thumbnails[3587822] = clik.newPhoto({"id":3587822,"src":"_DSC0006_200903141_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3587822.html","width":87,"caption":"Liquid metal","height":130});
															thumbnails[3827022] = clik.newPhoto({"id":3827022,"src":"_DSC00162009-05-02_Moonbay-Hermanus_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3827022.html","width":87,"caption":"Moonlight Bay Fishing","height":130});
															thumbnails[3937665] = clik.newPhoto({"id":3937665,"src":"De_Mond_2-061_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937665.html","width":90,"caption":"De Mond Walkway","height":130});
															thumbnails[3937666] = clik.newPhoto({"id":3937666,"src":"De_Mond_3-07_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937666.html","width":87,"caption":"Veins","height":130});
															thumbnails[3937673] = clik.newPhoto({"id":3937673,"src":"Desolate1_thumb.jpg","galleries_id":259668,"server_id":32,"link":"photo_3937673.html","width":87,"caption":"Desolate","height":130});
															thumbnails[3937685] = clik.newPhoto({"id":3937685,"src":"Riviersonderend1_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937685.html","width":87,"caption":"Riviersonderend","height":130});
															thumbnails[3938001] = clik.newPhoto({"id":3938001,"src":"_DSC00352009-05-18Nuwejaars-Vleilande_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3938001.html","width":87,"caption":"Nuwejaars Wetlands","height":130});
															thumbnails[3938008] = clik.newPhoto({"id":3938008,"src":"_DSC01282009-05-19Nuwejaars-Vleilande_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3938008.html","width":87,"caption":"Nuwejaars Wetlands","height":130});
															thumbnails[3963170] = clik.newPhoto({"id":3963170,"src":"_DSC00072009-05-26Duine_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3963170.html","width":87,"caption":"Brandfontein Dunes","height":130});
															thumbnails[3963172] = clik.newPhoto({"id":3963172,"src":"_DSC00412009-05-26Duine_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3963172.html","width":87,"caption":"Brandfontein Dunes","height":130});
															thumbnails[4136376] = clik.newPhoto({"id":4136376,"src":"_DSC00012009-06-18_Boesmanstrail_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4136376.html","width":87,"caption":"Boesmanskloof Trail","height":130});
															thumbnails[4136381] = clik.newPhoto({"id":4136381,"src":"_DSC00172009-06-18_Boesmanstrail_thumb.jpg","galleries_id":259668,"server_id":32,"link":"photo_4136381.html","width":87,"caption":"Boesmanskloof Trail","height":130});
															thumbnails[4256710] = clik.newPhoto({"id":4256710,"src":"_DSC00222009-07-07_LAgulhas_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4256710.html","width":87,"caption":"Wreck at L'Agulhas","height":130});
															thumbnails[4256940] = clik.newPhoto({"id":4256940,"src":"_DSC00992009-07-07_LAgulhas_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4256940.html","width":87,"caption":"Full moon at L'Agulhas","height":130});
															thumbnails[4359684] = clik.newPhoto({"id":4359684,"src":"_DSC00812009-07-21Pringlebaai_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4359684.html","width":87,"caption":"Cape Hangklip Lighthouse","height":130});
															thumbnails[4397896] = clik.newPhoto({"id":4397896,"src":"_DSC00332009-07-28Krige_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4397896.html","width":90,"caption":"Overberg","height":130});
															thumbnails[4743605] = clik.newPhoto({"id":4743605,"src":"_DSC00532009-09-17Agulhas_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4743605.html","width":87,"caption":"L'Agulhas Lighthouse","height":130});
															thumbnails[5071507] = clik.newPhoto({"id":5071507,"src":"_DSC00502009-10-25_Riviersonderend1_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5071507.html","width":93,"caption":"Wheat Swirls ","height":130});
															thumbnails[5727723] = clik.newPhoto({"id":5727723,"src":"Walker_Bay_NR_Walkway1_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5727723.html","width":87,"caption":"Walker Bay Nature Reserve Walkway","height":130});
															thumbnails[6000394] = clik.newPhoto({"id":6000394,"src":"310_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6000394.html","width":87,"caption":"Nesting birds","height":130});
															thumbnails[8336707] = clik.newPhoto({"id":8336707,"src":"_DSC3600_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8336707.html","width":130,"caption":"Leadwood at Hope","height":86});
															thumbnails[9074483] = clik.newPhoto({"id":9074483,"src":"372_Valley_of_Desolation_CCF5FD9D-24E8-5EC4-4F4346DC6B1D3372_thumb.jpg","galleries_id":186490,"server_id":32,"link":"photo_9074483.html","width":130,"caption":"Valley of Desolation","height":86});
															thumbnails[9074761] = clik.newPhoto({"id":9074761,"src":"373_1_thumb.jpg","galleries_id":186490,"server_id":35,"link":"photo_9074761.html","width":130,"caption":"Camdeboo Nature Reserve","height":86});
															thumbnails[9074852] = clik.newPhoto({"id":9074852,"src":"374_Pot_of_gold_1_thumb.jpg","galleries_id":186490,"server_id":35,"link":"photo_9074852.html","width":130,"caption":"Pot of gold","height":86});
															thumbnails[9081428] = clik.newPhoto({"id":9081428,"src":"375_Misty_gardens_1_thumb.jpg","galleries_id":186490,"server_id":35,"link":"photo_9081428.html","width":130,"caption":"Misty gardens","height":86});
															thumbnails[9081429] = clik.newPhoto({"id":9081429,"src":"376_08F6787C-1EC9-DFB6-096DD1C01D8A3D58_thumb.jpg","galleries_id":186490,"server_id":32,"link":"photo_9081429.html","width":130,"caption":"Camdeboo Nature Reserve","height":86});
															thumbnails[9081720] = clik.newPhoto({"id":9081720,"src":"377_Camdeboo_Nature_Reserve_thumb.jpg","galleries_id":186490,"server_id":32,"link":"photo_9081720.html","width":130,"caption":"Camdeboo Nature Reserve","height":86});
															thumbnails[9087571] = clik.newPhoto({"id":9087571,"src":"380_Hole_in_the_wall_redone_1_thumb.jpg","galleries_id":186490,"server_id":35,"link":"photo_9087571.html","width":130,"caption":"Hole in the wall ","height":86});
															thumbnails[9087572] = clik.newPhoto({"id":9087572,"src":"379_Gold_nuggets_1_thumb.jpg","galleries_id":186490,"server_id":35,"link":"photo_9087572.html","width":130,"caption":"Gold nuggets","height":86});
															thumbnails[9087676] = clik.newPhoto({"id":9087676,"src":"381_Driftwood_Beach_1_thumb.jpg","galleries_id":186490,"server_id":38,"link":"photo_9087676.html","width":130,"caption":"Driftwood Beach","height":86});
															thumbnails[3033590] = clik.newPhoto({"id":3033590,"src":"HH Reserve 30-10-200806_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3033590.html","width":130,"caption":"Fairy's Garden","height":88});
															thumbnails[3033592] = clik.newPhoto({"id":3033592,"src":"Overberg 03_thumb.10.jpg","galleries_id":165694,"server_id":32,"link":"photo_3033592.html","width":130,"caption":"Overberg","height":69});
															thumbnails[3033762] = clik.newPhoto({"id":3033762,"src":"HH Reserve 30-10-200805_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3033762.html","width":130,"caption":"Fire in the sky","height":82});
															thumbnails[3035083] = clik.newPhoto({"id":3035083,"src":"De Mond 2-201_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3035083.html","width":130,"caption":"De Mond Bridge","height":87});
															thumbnails[3138923] = clik.newPhoto({"id":3138923,"src":"DSC_00390524_thumb.10.jpg","galleries_id":165694,"server_id":32,"link":"photo_3138923.html","width":130,"caption":"Bales","height":87});
															thumbnails[3141309] = clik.newPhoto({"id":3141309,"src":"oes2008  01_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3141309.html","width":130,"caption":"Overberg Harvest","height":63});
															thumbnails[3325706] = clik.newPhoto({"id":3325706,"src":"Steenbrasdam1 03_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3325706.html","width":130,"caption":"Steenbras Dam","height":87});
															thumbnails[3325708] = clik.newPhoto({"id":3325708,"src":"Steenbrasdam1 05_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3325708.html","width":130,"caption":"Gatekeepers","height":87});
															thumbnails[3360470] = clik.newPhoto({"id":3360470,"src":"DSC_00770001_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3360470.html","width":130,"caption":"Everlasting Fynbos","height":87});
															thumbnails[3362470] = clik.newPhoto({"id":3362470,"src":"DSC_00830001_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3362470.html","width":130,"caption":"Steenbras Dam","height":87});
															thumbnails[3385580] = clik.newPhoto({"id":3385580,"src":"DSC_00092009-01-31_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3385580.html","width":130,"caption":"Full Circle","height":87});
															thumbnails[3463164] = clik.newPhoto({"id":3463164,"src":"DSC_00372009-02-17_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3463164.html","width":130,"caption":"Layered Cake","height":87});
															thumbnails[3466607] = clik.newPhoto({"id":3466607,"src":"DSC_00752009-02-17_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3466607.html","width":130,"caption":"Perfect Evening series","height":87});
															thumbnails[3467076] = clik.newPhoto({"id":3467076,"src":"DSC_00992009-02-17_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3467076.html","width":130,"caption":"Perfect Evening series","height":87});
															thumbnails[3497346] = clik.newPhoto({"id":3497346,"src":"DSC_0033 2009-02-24_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3497346.html","width":130,"caption":"Rain Dancers","height":87});
															thumbnails[3498945] = clik.newPhoto({"id":3498945,"src":"DSC_0037 2009-02-24_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3498945.html","width":130,"caption":"Smoking Skies","height":87});
															thumbnails[3903204] = clik.newPhoto({"id":3903204,"src":"De_Mond_2-231_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3903204.html","width":130,"caption":"De Mond Bridge","height":83});
															thumbnails[3903308] = clik.newPhoto({"id":3903308,"src":"Arniston_Cave_11_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3903308.html","width":130,"caption":"Arniston Cave","height":87});
															thumbnails[3937656] = clik.newPhoto({"id":3937656,"src":"Bettysbaai_2I_copy_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937656.html","width":130,"caption":"Rocky View","height":87});
															thumbnails[3937663] = clik.newPhoto({"id":3937663,"src":"Cranes_at_moonlight_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937663.html","width":130,"caption":"Cranes at moonlight","height":87});
															thumbnails[3937674] = clik.newPhoto({"id":3937674,"src":"DSC_00370424102008_-__thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937674.html","width":130,"caption":"Bales","height":87});
															thumbnails[3937683] = clik.newPhoto({"id":3937683,"src":"Mistique_3_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937683.html","width":130,"caption":"Mistique ","height":87});
															thumbnails[3937690] = clik.newPhoto({"id":3937690,"src":"Stoordeure1_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937690.html","width":130,"caption":"Barnhouse Doors","height":87});
															thumbnails[3937691] = clik.newPhoto({"id":3937691,"src":"TWK_Dam_Sonopkoms_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937691.html","width":130,"caption":"Peaches & Cream","height":87});
															thumbnails[3937733] = clik.newPhoto({"id":3937733,"src":"Ghost_Beach1_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3937733.html","width":130,"caption":"Ghost Beach","height":87});
															thumbnails[3938003] = clik.newPhoto({"id":3938003,"src":"_DSC00432009-05-18Nuwejaars-Vleilande_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3938003.html","width":130,"caption":"Nuwejaars Wetlands","height":87});
															thumbnails[3938007] = clik.newPhoto({"id":3938007,"src":"_DSC01212009-05-19Nuwejaars-Vleilande_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3938007.html","width":130,"caption":"Nuwejaars Wetlands","height":73});
															thumbnails[4004845] = clik.newPhoto({"id":4004845,"src":"_DSC00092009-05-29GreytonHelderstroom_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4004845.html","width":130,"caption":"Outgoing Autumn","height":69});
															thumbnails[4004846] = clik.newPhoto({"id":4004846,"src":"_DSC00102009-05-31_Hexrivier1_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4004846.html","width":130,"caption":"Hexrivier Valley","height":77});
															thumbnails[4004849] = clik.newPhoto({"id":4004849,"src":"_DSC00382009-05-29GreytonHelderstroom_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4004849.html","width":130,"caption":"Dissipating Storm","height":79});
															thumbnails[4215801] = clik.newPhoto({"id":4215801,"src":"_DSC00052009-06-18_Boesmanstrail_2_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4215801.html","width":130,"caption":"Boesmanskloof Trail","height":87});
															thumbnails[4359689] = clik.newPhoto({"id":4359689,"src":"_DSC00912009-07-21Pringlebaai_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4359689.html","width":130,"caption":"Cape Hangklip Lighthouse","height":87});
															thumbnails[4359694] = clik.newPhoto({"id":4359694,"src":"_DSC00932009-07-21Pringlebaai_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4359694.html","width":130,"caption":"Cape Hangklip","height":73});
															thumbnails[4446184] = clik.newPhoto({"id":4446184,"src":"_DSC00352009-08-04canola1i_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4446184.html","width":130,"caption":"Canola Splendor","height":87});
															thumbnails[4490896] = clik.newPhoto({"id":4490896,"src":"_DSC00652009-08-10_Tankwa_Karoo_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4490896.html","width":130,"caption":"Tankwa Karoo","height":78});
															thumbnails[4588749] = clik.newPhoto({"id":4588749,"src":"_DSC00042009-08-25Speelmansrivier-kop1_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4588749.html","width":130,"caption":"Overberg","height":87});
															thumbnails[4743604] = clik.newPhoto({"id":4743604,"src":"_DSC00522009-09-17Agulhas_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4743604.html","width":130,"caption":"L'Agulhas Lighthouse","height":87});
															thumbnails[4743609] = clik.newPhoto({"id":4743609,"src":"_DSC00712009-09-17Agulhas_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4743609.html","width":130,"caption":"L'Agulhas Shipwreck ","height":87});
															thumbnails[4743611] = clik.newPhoto({"id":4743611,"src":"_DSC00912009-09-17Agulhas_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4743611.html","width":130,"caption":"L'Agulhas Shipwreck","height":87});
															thumbnails[4743618] = clik.newPhoto({"id":4743618,"src":"_DSC01252009-09-17Agulhas_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4743618.html","width":130,"caption":"L'Agulhas Lighthouse","height":87});
															thumbnails[4765183] = clik.newPhoto({"id":4765183,"src":"_DSC00342009-09-19Danger_Point_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4765183.html","width":130,"caption":"Danger Point","height":87});
															thumbnails[5482977] = clik.newPhoto({"id":5482977,"src":"Forgotten_forests_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5482977.html","width":130,"caption":"Forgotten Forests","height":82});
															thumbnails[5487808] = clik.newPhoto({"id":5487808,"src":"Hottentots_Holland_Nature_Reserve12_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5487808.html","width":130,"caption":"Hottentots Holland Nature Reserve","height":87});
															thumbnails[5616935] = clik.newPhoto({"id":5616935,"src":"Kogelbaai_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5616935.html","width":130,"caption":"Kogel Bay","height":87});
															thumbnails[5654493] = clik.newPhoto({"id":5654493,"src":"Kogelbaai_iii_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5654493.html","width":130,"caption":"Kogel Bay","height":77});
															thumbnails[5654499] = clik.newPhoto({"id":5654499,"src":"Kogelbaai_4_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5654499.html","width":130,"caption":"Kogel Bay","height":60});
															thumbnails[5667460] = clik.newPhoto({"id":5667460,"src":"Sopiesklip_WalkerBayNR_11_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5667460.html","width":130,"caption":"Walker Bay Nature Reserve","height":87});
															thumbnails[5727722] = clik.newPhoto({"id":5727722,"src":"Walker_Bay_NR_Walkway_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5727722.html","width":130,"caption":"Walker Bay Nature Reserve Balustrade","height":86});
															thumbnails[5786144] = clik.newPhoto({"id":5786144,"src":"WalkerBayNR_2_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5786144.html","width":130,"caption":"Walker Bay Sunset","height":86});
															thumbnails[5805220] = clik.newPhoto({"id":5805220,"src":"WalkerBayNR_20100413_13_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5805220.html","width":130,"caption":"Walker Bay Pastels","height":86});
															thumbnails[5805221] = clik.newPhoto({"id":5805221,"src":"WalkerBayNR_20100414_16_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5805221.html","width":130,"caption":"Walker Bay Fishing","height":86});
															thumbnails[5818580] = clik.newPhoto({"id":5818580,"src":"WalkerBayNR_20100418_45_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5818580.html","width":130,"caption":"Walker Bay Night","height":86});
															thumbnails[5819181] = clik.newPhoto({"id":5819181,"src":"WalkerBayNR_20100417_28_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5819181.html","width":130,"caption":"Walker Bay Fishing","height":86});
															thumbnails[5819182] = clik.newPhoto({"id":5819182,"src":"WalkerBayNR_20100417_33_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5819182.html","width":130,"caption":"Walker Bay Fire Pot","height":86});
															thumbnails[6000395] = clik.newPhoto({"id":6000395,"src":"311_Klein_Pella_Mountain_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6000395.html","width":130,"caption":"Klein Pella Mountain","height":86});
															thumbnails[6000396] = clik.newPhoto({"id":6000396,"src":"312__DSC1572_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6000396.html","width":130,"caption":"Dusk at Klein Pella","height":86});
															thumbnails[6038742] = clik.newPhoto({"id":6038742,"src":"314_DSC1693i_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6038742.html","width":130,"caption":"Quiver tree nesting","height":86});
															thumbnails[6104736] = clik.newPhoto({"id":6104736,"src":"319_DSC0986_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6104736.html","width":130,"caption":"Quiver Tree Detail","height":86});
															thumbnails[6104737] = clik.newPhoto({"id":6104737,"src":"320_DSC1023_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6104737.html","width":130,"caption":"Quiver Tree Forest","height":86});
															thumbnails[6429477] = clik.newPhoto({"id":6429477,"src":"Vulkaan_stoordeure_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6429477.html","width":130,"caption":"Vulkaan Barnyard doors","height":86});
															thumbnails[6686422] = clik.newPhoto({"id":6686422,"src":"Knysna-_DSC2356_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6686422.html","width":130,"caption":"Knysna forest","height":86});
															thumbnails[6722448] = clik.newPhoto({"id":6722448,"src":"338_Knysna_Heads_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6722448.html","width":130,"caption":"Knysna Heads","height":86});
															thumbnails[7701720] = clik.newPhoto({"id":7701720,"src":"343_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7701720.html","width":130,"caption":"The Pulpit","height":86});
															thumbnails[7708935] = clik.newPhoto({"id":7708935,"src":"350_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7708935.html","width":130,"caption":"Sandstone Formation, Stadsaal Caves","height":86});
															thumbnails[7708942] = clik.newPhoto({"id":7708942,"src":"346_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7708942.html","width":130,"caption":"Stadsaal Caves","height":86});
															thumbnails[7708943] = clik.newPhoto({"id":7708943,"src":"347_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7708943.html","width":130,"caption":"Stadsaal Caves","height":86});
															thumbnails[7708944] = clik.newPhoto({"id":7708944,"src":"348_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7708944.html","width":130,"caption":"Stadsaal Caves","height":86});
															thumbnails[7708945] = clik.newPhoto({"id":7708945,"src":"349_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7708945.html","width":130,"caption":"Stadsaal Caves","height":86});
															thumbnails[7783219] = clik.newPhoto({"id":7783219,"src":"352_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7783219.html","width":130,"caption":"Truitjieskraal","height":86});
															thumbnails[7783220] = clik.newPhoto({"id":7783220,"src":"353_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7783220.html","width":130,"caption":"Truitjieskraal","height":86});
															thumbnails[7826496] = clik.newPhoto({"id":7826496,"src":"357_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7826496.html","width":130,"caption":"Wolfberg Cracks","height":87});
															thumbnails[7826498] = clik.newPhoto({"id":7826498,"src":"358_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7826498.html","width":130,"caption":"Wolfberg Cracks","height":86});
															thumbnails[7827482] = clik.newPhoto({"id":7827482,"src":"359_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7827482.html","width":130,"caption":"Truitjieskraal","height":87});
															thumbnails[7852737] = clik.newPhoto({"id":7852737,"src":"360_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7852737.html","width":130,"caption":"Truitjieskraal","height":86});
															thumbnails[8301742] = clik.newPhoto({"id":8301742,"src":"361_Hopes_Boabab_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8301742.html","width":130,"caption":"Hope's Boabab","height":86});
															thumbnails[8301745] = clik.newPhoto({"id":8301745,"src":"_DSC3709_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8301745.html","width":130,"caption":"Leopard's perch","height":86});
															thumbnails[8301748] = clik.newPhoto({"id":8301748,"src":"365_Where_Water_flows_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8301748.html","width":130,"caption":"Where water flows","height":86});
															thumbnails[8301749] = clik.newPhoto({"id":8301749,"src":"366i_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8301749.html","width":130,"caption":"Hope's lookout","height":77});
															thumbnails[8714058] = clik.newPhoto({"id":8714058,"src":"371_Phosporus_Walker_Bay1_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8714058.html","width":130,"caption":"Phosphorus Walker Bay","height":86});
															thumbnails[3753644] = clik.newPhoto({"id":3753644,"src":"Untitled_Panorama1_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_3753644.html","width":130,"caption":"De Mond Reserve Panorama","height":23});
															thumbnails[4215798] = clik.newPhoto({"id":4215798,"src":"Boesmanskloof_Trail_2_thumb.jpg","galleries_id":259668,"server_id":32,"link":"photo_4215798.html","width":130,"caption":"Boesmanskloof Trail Panorama","height":33});
															thumbnails[4221279] = clik.newPhoto({"id":4221279,"src":"TWK_Pano_2606_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4221279.html","width":130,"caption":"Villiersdorp Panorama","height":29});
															thumbnails[4359698] = clik.newPhoto({"id":4359698,"src":"Hangklip_Pano_-_6fotos_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4359698.html","width":130,"caption":"Hangklip Panoramic","height":28});
															thumbnails[4446176] = clik.newPhoto({"id":4446176,"src":"Harwegsrivier_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4446176.html","width":130,"caption":"Canola Field Panoramic","height":30});
															thumbnails[4490900] = clik.newPhoto({"id":4490900,"src":"Koue_Bokkeveld_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_4490900.html","width":130,"caption":"Tankwa Karoo Panoramic","height":57});
															thumbnails[5574604] = clik.newPhoto({"id":5574604,"src":"Arniston_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_5574604.html","width":130,"caption":"Arniston","height":43});
															thumbnails[6120526] = clik.newPhoto({"id":6120526,"src":"321_DSC1022_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6120526.html","width":130,"caption":"Quiver Tree Sunset","height":57});
															thumbnails[6120730] = clik.newPhoto({"id":6120730,"src":"322_DSC1015_thumb.jpg","galleries_id":259668,"server_id":32,"link":"photo_6120730.html","width":130,"caption":"Quiver Tree Forest","height":57});
															thumbnails[6125337] = clik.newPhoto({"id":6125337,"src":"324_Ararat_Pano_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6125337.html","width":130,"caption":"Ararat","height":48});
															thumbnails[6153032] = clik.newPhoto({"id":6153032,"src":"325_thumb.jpg","galleries_id":259668,"server_id":32,"link":"photo_6153032.html","width":130,"caption":"Incandescent Quiver Trees","height":57});
															thumbnails[6620322] = clik.newPhoto({"id":6620322,"src":"Knysna-_DSC2317i_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6620322.html","width":130,"caption":"Road to oblivion","height":57});
															thumbnails[6620323] = clik.newPhoto({"id":6620323,"src":"Knysna-_DSC2353vi_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6620323.html","width":130,"caption":"Knysna Forest","height":57});
															thumbnails[6686420] = clik.newPhoto({"id":6686420,"src":"333i_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6686420.html","width":130,"caption":"Landscape of the Gnomes","height":57});
															thumbnails[6689121] = clik.newPhoto({"id":6689121,"src":"335_Knysna_Heads_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6689121.html","width":130,"caption":"The Knysna Heads","height":53});
															thumbnails[6722447] = clik.newPhoto({"id":6722447,"src":"337__Valley_of_the_Ferns_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_6722447.html","width":130,"caption":"Valley of the Ferns","height":57});
															thumbnails[7336967] = clik.newPhoto({"id":7336967,"src":"20110120_87_DSC2814_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7336967.html","width":130,"caption":"Otori Maru","height":57});
															thumbnails[7783218] = clik.newPhoto({"id":7783218,"src":"351_Truitjieskraal_Pano_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7783218.html","width":130,"caption":"Truitjieskraal Pano","height":62});
															thumbnails[7783221] = clik.newPhoto({"id":7783221,"src":"354_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7783221.html","width":130,"caption":"Truitjieskraal","height":57});
															thumbnails[7783222] = clik.newPhoto({"id":7783222,"src":"355_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7783222.html","width":130,"caption":"Kissing Rocks, Truitjieskraal","height":57});
															thumbnails[7826503] = clik.newPhoto({"id":7826503,"src":"356_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_7826503.html","width":130,"caption":"Truitjieskraal Pano","height":63});
															thumbnails[8301743] = clik.newPhoto({"id":8301743,"src":"362i_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8301743.html","width":130,"caption":"Hope's Autumn","height":57});
															thumbnails[8301744] = clik.newPhoto({"id":8301744,"src":"363i_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8301744.html","width":130,"caption":"Mopane Forest","height":57});
															thumbnails[8301746] = clik.newPhoto({"id":8301746,"src":"367i_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8301746.html","width":130,"caption":"Hope's Legacy","height":57});
															thumbnails[8301747] = clik.newPhoto({"id":8301747,"src":"_DSC3717_thumb.jpg","galleries_id":165694,"server_id":32,"link":"photo_8301747.html","width":130,"caption":"Lowveldt haven","height":57});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[186490] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Recent","link":"gallery_186490.html","maxRecords":0.0,"photoIDs":[9074483.0,9074761.0,9074852.0,9081428.0,9081429.0,9081720.0,9087571.0,9087572.0,9087676.0],"skipIndex":0,"section_code":"gallery","featured_images":"9087676,9074483","id":186490,"singleSection":false});				  						galleries[165694] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_165694.html","maxRecords":0.0,"photoIDs":[3033591.0,3325710.0,3325711.0,3360441.0,3398909.0,3467074.0,3471431.0,3472295.0,3498948.0,3534798.0,3587822.0,3827022.0,3937665.0,3937666.0,3937685.0,3938001.0,3938008.0,3963170.0,3963172.0,4136376.0,4256710.0,4256940.0,4359684.0,4397896.0,4743605.0,5071507.0,5727723.0,6000394.0,8336707.0,3033590.0,3033592.0,3033762.0,3035083.0,3138923.0,3141309.0,3325706.0,3325708.0,3360470.0,3362470.0,3385580.0,3463164.0,3466607.0,3467076.0,3497346.0,3498945.0,3903204.0,3903308.0,3937656.0,3937663.0,3937674.0,3937683.0,3937690.0,3937691.0,3937733.0,3938003.0,3938007.0,4004845.0,4004846.0,4004849.0,4215801.0,4359689.0,4359694.0,4446184.0,4490896.0,4588749.0,4743604.0,4743609.0,4743611.0,4743618.0,4765183.0,5482977.0,5487808.0,5616935.0,5654493.0,5654499.0,5667460.0,5727722.0,5786144.0,5805220.0,5805221.0,5818580.0,5819181.0,5819182.0,6000395.0,6000396.0,6038742.0,6104736.0,6104737.0,6429477.0,6686422.0,6722448.0,7701720.0,7708935.0,7708942.0,7708943.0,7708944.0,7708945.0,7783219.0,7783220.0,7826496.0,7826498.0,7827482.0,7852737.0,8301742.0,8301745.0,8301748.0,8301749.0,8714058.0,3753644.0,4221279.0,4359698.0,4446176.0,4490900.0,5574604.0,6120526.0,6125337.0,6620322.0,6620323.0,6686420.0,6689121.0,6722447.0,7336967.0,7783218.0,7783221.0,7783222.0,7826503.0,8301743.0,8301744.0,8301746.0,8301747.0],"skipIndex":0,"section_code":"gallery","featured_images":"8301742,7826503,7783222,7783218,7701720,6722447,6689121,6620323,6429477,5727722,5574604,4588749,4446184","id":165694,"singleSection":false});				  						galleries[259668] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Limited editions","link":"gallery_259668.html","maxRecords":0.0,"photoIDs":[3937673.0,4136381.0,4215798.0,6120730.0,6153032.0],"skipIndex":0,"section_code":"gallery","featured_images":"6120730,4136381,3937673","id":259668,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[238721] = '3325711,5819182,5805221,5727722';
imageSets[1] = '9087676,4136381,3360441,8714058,7708935,7701720,5819182,5805221,5727722,4588749,4446184,3141309,8301746,7826503,7783222,7783218,7336967,6722447,6689121,6120730,5574604';
imageSets[2] = '9087676,9074483,4136381,3937673,8301742,7701720,6429477,5727722,4588749,4446184,7826503,7783222,7783218,6722447,6689121,6620323,6120730,5574604';
imageSets[3] = '6125337';
imageSets[238722] = '3325711';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Liesel/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Liesel/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Liesel/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Liesel/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Liesel/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Liesel/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Liesel/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Liesel/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = (backgrounds || photos || {})[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Landscape Photography: Liesel Kershoff: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> $' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			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 += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="">';
					temp += '<input type="hidden" name="currency_code" value="USD">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

