window.thumbnails = {};
															thumbnails[7329132] = clik.newPhoto({"id":7329132,"src":"Goodwood_Vintage_2010_-_2_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Goodwood Vintage - 2","height":197});
															thumbnails[3939435] = clik.newPhoto({"id":3939435,"src":"SnowinWithdeanPark1_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_3939435.html","width":130,"caption":"A snowy morning in Withdean Park, Brighton","height":87});
															thumbnails[146654] = clik.newPhoto({"id":146654,"src":"Rialto_Bridge_thumb.jpg","galleries_id":236292,"server_id":15,"link":"photo_146654.html","width":130,"caption":"Rialto Bridge, Venice","height":80});
															thumbnails[146711] = clik.newPhoto({"id":146711,"src":"Field-a1_thumb.jpg","galleries_id":13583,"server_id":15,"link":"photo_146711.html","width":130,"caption":"Ready for the Harvest","height":91});
															thumbnails[150760] = clik.newPhoto({"id":150760,"src":"Goldoni_Courtyard1_thumb.jpg","galleries_id":236292,"server_id":15,"link":"photo_150760.html","width":130,"caption":"Goldoni Courtyard, Venice","height":65});
															thumbnails[150767] = clik.newPhoto({"id":150767,"src":"Gondoliers_thumb.jpg","galleries_id":236292,"server_id":15,"link":"photo_150767.html","width":130,"caption":"Gondoliers on the Grand Canal","height":51});
															thumbnails[150773] = clik.newPhoto({"id":150773,"src":"Palacio_da_Pena1_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_150773.html","width":130,"caption":"Palacio da Pena, Sintra, Portugal","height":98});
															thumbnails[158652] = clik.newPhoto({"id":158652,"src":"Sunset_Lake_Nasser_1_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_158652.html","width":130,"caption":"Sunset 1 Lake Nasser, Egypt","height":58});
															thumbnails[158653] = clik.newPhoto({"id":158653,"src":"Sunset_Lake_Nasser_2_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_158653.html","width":130,"caption":"Sunset 2 Lake Nasser, Egypt","height":71});
															thumbnails[158950] = clik.newPhoto({"id":158950,"src":"Sri_Lankan_Tea_Boy_thumb.jpg","galleries_id":13575,"server_id":15,"link":"photo_158950.html","width":130,"caption":"Tea Boy, Sri Lanka","height":189});
															thumbnails[176893] = clik.newPhoto({"id":176893,"src":"San Giorgio Maggiore_thumb.jpg","galleries_id":236292,"server_id":15,"link":"photo_176893.html","width":130,"caption":"San Giorgio Maggiore, Venice","height":50});
															thumbnails[176897] = clik.newPhoto({"id":176897,"src":"Sunset across the Nile_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_176897.html","width":130,"caption":"Sunset across the Nile, Luxor, Egypt","height":92});
															thumbnails[176899] = clik.newPhoto({"id":176899,"src":"Burano Reflection_thumb.jpg","galleries_id":236292,"server_id":15,"link":"photo_176899.html","width":130,"caption":"Burano Reflection, Venice","height":98});
															thumbnails[176901] = clik.newPhoto({"id":176901,"src":"Grand Canal_thumb.jpg","galleries_id":236292,"server_id":15,"link":"photo_176901.html","width":130,"caption":"Santa Maria della Salute, Venice","height":98});
															thumbnails[217885] = clik.newPhoto({"id":217885,"src":"Dungeness_thumb.jpg","galleries_id":19785,"server_id":15,"link":"photo_217885.html","width":130,"caption":"LRPS Panel - Dungeness","height":87});
															thumbnails[309947] = clik.newPhoto({"id":309947,"src":"La Fenice-a060620_thumb.jpg","galleries_id":236292,"server_id":15,"link":"photo_309947.html","width":130,"caption":"La Fenice, Venice","height":175});
															thumbnails[949049] = clik.newPhoto({"id":949049,"src":"Seascape-1_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_949049.html","width":130,"caption":"Seascape 1","height":87});
															thumbnails[949055] = clik.newPhoto({"id":949055,"src":"The Estuary at Low Tide-2_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_949055.html","width":130,"caption":"The Estuary at Low Tide, Baie de Somme - 2","height":175});
															thumbnails[949060] = clik.newPhoto({"id":949060,"src":"The Estuary at Low Tide-3_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_949060.html","width":130,"caption":"The Estuary at Low Tide, Baie de Somme - 3","height":87});
															thumbnails[949063] = clik.newPhoto({"id":949063,"src":"The Islands_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_949063.html","width":130,"caption":"The Islands, Dalmatian Coast, Croatia","height":87});
															thumbnails[2153055] = clik.newPhoto({"id":2153055,"src":"Large pebbles_thumb.jpg","galleries_id":361671,"server_id":15,"link":"photo_2153055.html","width":130,"caption":"Pebbles","height":63});
															thumbnails[2153100] = clik.newPhoto({"id":2153100,"src":"Mood Blue_thumb.jpg","galleries_id":361671,"server_id":15,"link":"photo_2153100.html","width":130,"caption":"Mood Blue","height":81});
															thumbnails[2253688] = clik.newPhoto({"id":2253688,"src":"Birling Gap Sunset no_thumb.41.jpg","galleries_id":13574,"server_id":15,"link":"photo_2253688.html","width":130,"caption":"Birling Gap Sunset no.4","height":81});
															thumbnails[2253691] = clik.newPhoto({"id":2253691,"src":"Birling Gap Sunset no31_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_2253691.html","width":130,"caption":"Birling Gap Sunset no.3","height":85});
															thumbnails[2253695] = clik.newPhoto({"id":2253695,"src":"After the sun has set1_thumb.jpg","galleries_id":361671,"server_id":15,"link":"photo_2253695.html","width":130,"caption":"After the Sun has Set","height":87});
															thumbnails[3872024] = clik.newPhoto({"id":3872024,"src":"BrightonReflections_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_3872024.html","width":130,"caption":"Reflections of Brighton","height":65});
															thumbnails[3872256] = clik.newPhoto({"id":3872256,"src":"DeckChairsonthePier_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_3872256.html","width":130,"caption":"Deck Chairs on the Pier","height":65});
															thumbnails[3872272] = clik.newPhoto({"id":3872272,"src":"Anythingyoucando1_thumb.jpg","galleries_id":235315,"server_id":15,"link":"photo_3872272.html","width":130,"caption":"Anything You Can Do!","height":195});
															thumbnails[3875097] = clik.newPhoto({"id":3875097,"src":"StarlingsoverthePier_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_3875097.html","width":130,"caption":"Starlings over the Pier at Dusk","height":130});
															thumbnails[3875123] = clik.newPhoto({"id":3875123,"src":"TheWhiteJug1_thumb.jpg","galleries_id":361671,"server_id":15,"link":"photo_3875123.html","width":130,"caption":"The White Jug","height":170});
															thumbnails[3875127] = clik.newPhoto({"id":3875127,"src":"PalmTrees21_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_3875127.html","width":130,"caption":"Palm Trees in the Pacific, Hawaii","height":195});
															thumbnails[3875134] = clik.newPhoto({"id":3875134,"src":"TropicalParadise2_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_3875134.html","width":130,"caption":"Tropical Paradise Hawaii no.2","height":195});
															thumbnails[3875142] = clik.newPhoto({"id":3875142,"src":"HoveGraffiti1_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_3875142.html","width":130,"caption":"Hove Graffiti","height":130});
															thumbnails[3875148] = clik.newPhoto({"id":3875148,"src":"TropicalParadise4_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_3875148.html","width":130,"caption":"Tropical Paradise Hawaii no.4","height":130});
															thumbnails[3881551] = clik.newPhoto({"id":3881551,"src":"VenetianReflection_thumb.jpg","galleries_id":236292,"server_id":15,"link":"photo_3881551.html","width":130,"caption":"Venetian Reflection","height":195});
															thumbnails[3881554] = clik.newPhoto({"id":3881554,"src":"SunsetonWaikikiBeach_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_3881554.html","width":130,"caption":"Sunset on Waikiki Beach, Hawaii","height":87});
															thumbnails[3881563] = clik.newPhoto({"id":3881563,"src":"SpiralStaircase_thumb.jpg","galleries_id":13583,"server_id":15,"link":"photo_3881563.html","width":130,"caption":"The Spiral Staircase","height":195});
															thumbnails[3881567] = clik.newPhoto({"id":3881567,"src":"StillLifeattheBritishMuseum_thumb.jpg","galleries_id":361671,"server_id":15,"link":"photo_3881567.html","width":130,"caption":"Still Life at the British Museum","height":85});
															thumbnails[3881619] = clik.newPhoto({"id":3881619,"src":"BrightonsWestPier_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_3881619.html","width":130,"caption":"The West Pier","height":65});
															thumbnails[3881623] = clik.newPhoto({"id":3881623,"src":"BrightonMontage_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_3881623.html","width":130,"caption":"Images of Brighton","height":130});
															thumbnails[3881627] = clik.newPhoto({"id":3881627,"src":"GoldenGateBridge_thumb.jpg","galleries_id":13583,"server_id":15,"link":"photo_3881627.html","width":130,"caption":"Golden Gate Bridge","height":80});
															thumbnails[3890916] = clik.newPhoto({"id":3890916,"src":"HarvestingSeaweed_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_3890916.html","width":130,"caption":"Harvesting Seaweed","height":60});
															thumbnails[3890924] = clik.newPhoto({"id":3890924,"src":"TheGatheringStorm_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_3890924.html","width":130,"caption":"The Gathering Storm","height":195});
															thumbnails[3890927] = clik.newPhoto({"id":3890927,"src":"HotLips_thumb.jpg","galleries_id":236288,"server_id":15,"link":"photo_3890927.html","width":130,"caption":"Hot Lips!","height":86});
															thumbnails[3931858] = clik.newPhoto({"id":3931858,"src":"MistyMorn2_thumb.jpg","galleries_id":235315,"server_id":15,"link":"photo_3931858.html","width":130,"caption":"Misty Morn over Laxey Valley<br>\r\nLondon Salon of Photography Acceptance 2009<br>\r\n","height":43});
															thumbnails[3939509] = clik.newPhoto({"id":3939509,"src":"BlueVenice_thumb.jpg","galleries_id":236292,"server_id":15,"link":"photo_3939509.html","width":130,"caption":"Blue Venice","height":86});
															thumbnails[3939512] = clik.newPhoto({"id":3939512,"src":"Dani_thumb.jpg","galleries_id":13575,"server_id":15,"link":"photo_3939512.html","width":130,"caption":"Dani 2008","height":197});
															thumbnails[3939515] = clik.newPhoto({"id":3939515,"src":"DoIlookgoodinthis_thumb.jpg","galleries_id":236288,"server_id":15,"link":"photo_3939515.html","width":130,"caption":"Do I look good in this?","height":190});
															thumbnails[3939518] = clik.newPhoto({"id":3939518,"src":"OfftheshoreofZanzibar_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_3939518.html","width":130,"caption":"Off the shore of Zanzibar","height":94});
															thumbnails[3939521] = clik.newPhoto({"id":3939521,"src":"SolitaryTulip_thumb.jpg","galleries_id":361671,"server_id":15,"link":"photo_3939521.html","width":130,"caption":"Solitary Tulip","height":87});
															thumbnails[3939522] = clik.newPhoto({"id":3939522,"src":"TheDoctorandhisLady_thumb.jpg","galleries_id":236288,"server_id":15,"link":"photo_3939522.html","width":130,"caption":"The Doctor and his Lady","height":188});
															thumbnails[3939527] = clik.newPhoto({"id":3939527,"src":"TwoGiraffes_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_3939527.html","width":130,"caption":"Two Giraffes - they don't look it, but they were in the middle of a fight!","height":236});
															thumbnails[4976895] = clik.newPhoto({"id":4976895,"src":"Niamh1_thumb.jpg","galleries_id":13575,"server_id":15,"link":"photo_4976895.html","width":130,"caption":"Niamh","height":171});
															thumbnails[4978130] = clik.newPhoto({"id":4978130,"src":"Coastal_Corrosion_thumb.jpg","galleries_id":282837,"server_id":15,"link":"photo_4978130.html","width":130,"caption":"ARPS Panel","height":92});
															thumbnails[5372848] = clik.newPhoto({"id":5372848,"src":"Early_Morning_Derwentwater-1_thumb.jpg","galleries_id":42033,"server_id":15,"link":"photo_5372848.html","width":130,"caption":"Early Morning, Derwentwater, no.1<br>\r\n","height":41});
															thumbnails[5372857] = clik.newPhoto({"id":5372857,"src":"EarlyMorningDerwentwater-2_thumb.jpg","galleries_id":42033,"server_id":15,"link":"photo_5372857.html","width":130,"caption":"Early Morning, Derwentwater, no.2","height":62});
															thumbnails[5372862] = clik.newPhoto({"id":5372862,"src":"EarlyMorningDerwentwater-3_thumb.jpg","galleries_id":42033,"server_id":15,"link":"photo_5372862.html","width":130,"caption":"Early Morning, Derwentwater, no.3","height":60});
															thumbnails[6574286] = clik.newPhoto({"id":6574286,"src":"Goodwood_Vintage_2010_-_31_thumb.jpg","galleries_id":361652,"server_id":15,"link":"photo_6574286.html","width":130,"caption":"Goodwood Vintage 2010-3","height":180});
															thumbnails[6598899] = clik.newPhoto({"id":6598899,"src":"Goodwood_Vintage-4_thumb.jpg","galleries_id":361652,"server_id":15,"link":"photo_6598899.html","width":130,"caption":"Goodwood Vintage 2010 - 4","height":89});
															thumbnails[6598902] = clik.newPhoto({"id":6598902,"src":"Goodwood_Vintage-5_thumb.jpg","galleries_id":361652,"server_id":15,"link":"photo_6598902.html","width":130,"caption":"Goodwood Vintage 2010 - 5<br>\r\n","height":185});
															thumbnails[6598906] = clik.newPhoto({"id":6598906,"src":"Goodwood_Vintage-7_thumb.jpg","galleries_id":361652,"server_id":15,"link":"photo_6598906.html","width":130,"caption":"Goodwood Vintage 2010 - 7<br>\r\n","height":87});
															thumbnails[6598908] = clik.newPhoto({"id":6598908,"src":"Goodwood_Vintage-8_thumb.jpg","galleries_id":361652,"server_id":15,"link":"photo_6598908.html","width":130,"caption":"Goodwood Vintage 2010 - 8","height":130});
															thumbnails[6598911] = clik.newPhoto({"id":6598911,"src":"Goodwood_Vintage-9_thumb.jpg","galleries_id":361652,"server_id":15,"link":"photo_6598911.html","width":130,"caption":"Goodwood Vintage 2010 - 9","height":146});
															thumbnails[6599141] = clik.newPhoto({"id":6599141,"src":"Southbank-1_thumb.jpg","galleries_id":361659,"server_id":15,"link":"photo_6599141.html","width":130,"caption":"Reflections of the Southbank","height":195});
															thumbnails[6599143] = clik.newPhoto({"id":6599143,"src":"Southbank-2_thumb.jpg","galleries_id":453491,"server_id":15,"link":"photo_6599143.html","width":130,"caption":"London's Southbank-1","height":191});
															thumbnails[6599149] = clik.newPhoto({"id":6599149,"src":"Southbank-3_thumb.jpg","galleries_id":361659,"server_id":15,"link":"photo_6599149.html","width":130,"caption":"Ballet Rehearsal, Tate Modern","height":78});
															thumbnails[6599151] = clik.newPhoto({"id":6599151,"src":"Southbank-4_thumb.jpg","galleries_id":361659,"server_id":15,"link":"photo_6599151.html","width":130,"caption":"Ballet Rehearsal, Tate Modern","height":87});
															thumbnails[6599153] = clik.newPhoto({"id":6599153,"src":"Southbank-5_thumb.jpg","galleries_id":361659,"server_id":15,"link":"photo_6599153.html","width":130,"caption":"Having Fun!","height":86});
															thumbnails[8576298] = clik.newPhoto({"id":8576298,"src":"Lois_thumb.jpg","galleries_id":13575,"server_id":35,"link":"photo_8576298.html","width":130,"caption":"Lois","height":88});
															thumbnails[8576302] = clik.newPhoto({"id":8576302,"src":"Tiger_Cages_Vietnam_thumb.jpg","galleries_id":386347,"server_id":35,"link":"photo_8576302.html","width":130,"caption":"Tiger Cages, Vietnam","height":67});
															thumbnails[8576303] = clik.newPhoto({"id":8576303,"src":"Paris_Plage_Le_Touquet_thumb.jpg","galleries_id":13583,"server_id":35,"link":"photo_8576303.html","width":130,"caption":"Paris Plage, Le Touquet","height":98});
															thumbnails[8576307] = clik.newPhoto({"id":8576307,"src":"Gardenia_thumb.jpg","galleries_id":361671,"server_id":35,"link":"photo_8576307.html","width":130,"caption":"Gardenia","height":99});
															thumbnails[8577753] = clik.newPhoto({"id":8577753,"src":"La_Defence_Paris_thumb.jpg","galleries_id":453491,"server_id":35,"link":"photo_8577753.html","width":130,"caption":"La Defence, Paris","height":195});
															thumbnails[8577756] = clik.newPhoto({"id":8577756,"src":"Contemplation_thumb.jpg","galleries_id":13577,"server_id":35,"link":"photo_8577756.html","width":130,"caption":"Looking out to sea","height":98});
															thumbnails[8577757] = clik.newPhoto({"id":8577757,"src":"London_Southbank_thumb.jpg","galleries_id":453491,"server_id":35,"link":"photo_8577757.html","width":130,"caption":"London's Southbank-2","height":91});
															thumbnails[146653] = clik.newPhoto({"id":146653,"src":"Graffiti_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_146653.html","width":130,"caption":"Graffiti","height":66});
															thumbnails[949052] = clik.newPhoto({"id":949052,"src":"The Estuary at Low Tide-1_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_949052.html","width":130,"caption":"The Estuary at Low Tide, Baie de Somme - 1","height":87});
															thumbnails[7148589] = clik.newPhoto({"id":7148589,"src":"Mekong-Delta_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148589.html","width":130,"caption":"Mekong Delta","height":130});
															thumbnails[7152126] = clik.newPhoto({"id":7152126,"src":"Girl-with-Nose-Ring_thumb.jpg","galleries_id":361652,"server_id":15,"link":"photo_7152126.html","width":130,"caption":"","height":198});
															thumbnails[7321924] = clik.newPhoto({"id":7321924,"src":"Courchevel-1_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321924.html","width":130,"caption":"Courchevel-1","height":63});
															thumbnails[158937] = clik.newPhoto({"id":158937,"src":"Brighton Pavilion_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_158937.html","width":130,"caption":"Royal Pavilion","height":90});
															thumbnails[7148613] = clik.newPhoto({"id":7148613,"src":"Young_Monk-1_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148613.html","width":130,"caption":"Young Monk-1","height":200});
															thumbnails[7321933] = clik.newPhoto({"id":7321933,"src":"Courchevel-1bw2_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321933.html","width":130,"caption":"Courchevel-1 (bw)","height":65});
															thumbnails[151390] = clik.newPhoto({"id":151390,"src":"Waltzer_Sunset_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_151390.html","width":130,"caption":"Waltzer Sunset","height":87});
															thumbnails[6598904] = clik.newPhoto({"id":6598904,"src":"Goodwood_Vintage-6_thumb.jpg","galleries_id":361652,"server_id":15,"link":"photo_6598904.html","width":130,"caption":"Goodwood Vintage 2010 - 6","height":199});
															thumbnails[7148615] = clik.newPhoto({"id":7148615,"src":"Young_Monk-2_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148615.html","width":130,"caption":"Young Monk-2","height":218});
															thumbnails[7321926] = clik.newPhoto({"id":7321926,"src":"Courchevel-2_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321926.html","width":130,"caption":"Courchevel-2","height":51});
															thumbnails[7148606] = clik.newPhoto({"id":7148606,"src":"Pretty_Little_Girl_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148606.html","width":130,"caption":"Pretty Little Girl!","height":195});
															thumbnails[7321930] = clik.newPhoto({"id":7321930,"src":"Courchevel-2bw1_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321930.html","width":130,"caption":"Courchevel-2 (bw)","height":53});
															thumbnails[7148617] = clik.newPhoto({"id":7148617,"src":"Who_cares_about_the_rain_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148617.html","width":130,"caption":"Who cares about the rain","height":71});
															thumbnails[7321935] = clik.newPhoto({"id":7321935,"src":"Courchevel-3_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321935.html","width":130,"caption":"Courchevel-3","height":87});
															thumbnails[949050] = clik.newPhoto({"id":949050,"src":"Seven Sisters from Birling Gap_thumb.jpg","galleries_id":13574,"server_id":15,"link":"photo_949050.html","width":130,"caption":"Seven Sisters from Birling Gap","height":87});
															thumbnails[7148592] = clik.newPhoto({"id":7148592,"src":"Off-to_school_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148592.html","width":130,"caption":"Off to School","height":95});
															thumbnails[7321937] = clik.newPhoto({"id":7321937,"src":"Courchevel-3bw_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321937.html","width":130,"caption":"Courchevel-3 (bw)","height":87});
															thumbnails[7148595] = clik.newPhoto({"id":7148595,"src":"Peeking_Out_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148595.html","width":130,"caption":"Peeking Out","height":177});
															thumbnails[7321938] = clik.newPhoto({"id":7321938,"src":"Courchevel-4_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321938.html","width":130,"caption":"Courchevel-4","height":87});
															thumbnails[7148164] = clik.newPhoto({"id":7148164,"src":"Starting_Young_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148164.html","width":130,"caption":"Learning to ride","height":185});
															thumbnails[7321939] = clik.newPhoto({"id":7321939,"src":"Courchevel-5_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321939.html","width":130,"caption":"Courchevel-5","height":55});
															thumbnails[949048] = clik.newPhoto({"id":949048,"src":"Dalmatian Coast_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_949048.html","width":130,"caption":"Dalmatian Coast","height":87});
															thumbnails[7148600] = clik.newPhoto({"id":7148600,"src":"Praying_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148600.html","width":130,"caption":"Praying","height":197});
															thumbnails[7321940] = clik.newPhoto({"id":7321940,"src":"Courchevel-6_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321940.html","width":130,"caption":"Courchevel-6","height":216});
															thumbnails[542059] = clik.newPhoto({"id":542059,"src":"WCP-l_thumb.jpg","galleries_id":13577,"server_id":15,"link":"photo_542059.html","width":130,"caption":"Shelter from the blistering sun","height":87});
															thumbnails[6563329] = clik.newPhoto({"id":6563329,"src":"WhatsHeThinking2_thumb.jpg","galleries_id":302937,"server_id":15,"link":"photo_6563329.html","width":130,"caption":"What's He Thinking-2?","height":89});
															thumbnails[7148556] = clik.newPhoto({"id":7148556,"src":"Going_to-pray_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148556.html","width":130,"caption":"Going to pray","height":195});
															thumbnails[7321941] = clik.newPhoto({"id":7321941,"src":"Courchevel-7_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321941.html","width":130,"caption":"Courchevel-7","height":80});
															thumbnails[5372879] = clik.newPhoto({"id":5372879,"src":"Whatshethinking_thumb.jpg","galleries_id":302937,"server_id":15,"link":"photo_5372879.html","width":130,"caption":"What's he thinking?","height":87});
															thumbnails[7148542] = clik.newPhoto({"id":7148542,"src":"Fishing_in_the_South_China_Sea_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148542.html","width":130,"caption":"Fishing in the South China Sea","height":87});
															thumbnails[7321942] = clik.newPhoto({"id":7321942,"src":"La-Tania-2_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321942.html","width":130,"caption":"La Tania-2","height":56});
															thumbnails[6563335] = clik.newPhoto({"id":6563335,"src":"CigarLady_thumb.jpg","galleries_id":302937,"server_id":15,"link":"photo_6563335.html","width":130,"caption":"Cigar Lady","height":195});
															thumbnails[7148544] = clik.newPhoto({"id":7148544,"src":"Fishing_Lak_Lake_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148544.html","width":130,"caption":"Fishing Lak Lake","height":69});
															thumbnails[7321943] = clik.newPhoto({"id":7321943,"src":"La-Tania-dusk_thumb.jpg","galleries_id":396119,"server_id":15,"link":"photo_7321943.html","width":130,"caption":"La Tania at dusk","height":87});
															thumbnails[6563375] = clik.newPhoto({"id":6563375,"src":"TheTobaccoFarmer2_thumb.jpg","galleries_id":302937,"server_id":15,"link":"photo_6563375.html","width":130,"caption":"The Tobacco Farmer-2","height":192});
															thumbnails[7148557] = clik.newPhoto({"id":7148557,"src":"Hai_Van_Pass_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148557.html","width":130,"caption":"Hai Van Pass","height":87});
															thumbnails[5372876] = clik.newPhoto({"id":5372876,"src":"TheTobaccoFarmer_thumb.jpg","galleries_id":302937,"server_id":15,"link":"photo_5372876.html","width":130,"caption":"The Tobacco Farmer","height":192});
															thumbnails[7148561] = clik.newPhoto({"id":7148561,"src":"Halong_Bay-4_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148561.html","width":130,"caption":"Halong Bay-4","height":57});
															thumbnails[6563353] = clik.newPhoto({"id":6563353,"src":"ToomanyHavanaClubs_thumb.jpg","galleries_id":302937,"server_id":15,"link":"photo_6563353.html","width":130,"caption":"Too Many Havana Clubs!!","height":87});
															thumbnails[7148562] = clik.newPhoto({"id":7148562,"src":"Halong_Bay-5_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148562.html","width":130,"caption":"Halong Bay Boat People","height":84});
															thumbnails[6563374] = clik.newPhoto({"id":6563374,"src":"ItsHotOutside_thumb.jpg","galleries_id":302937,"server_id":15,"link":"photo_6563374.html","width":130,"caption":"It's Hot Outside!!","height":98});
															thumbnails[7148809] = clik.newPhoto({"id":7148809,"src":"Halong_Bay_Cave_detail_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148809.html","width":130,"caption":"Halong Bay cave detail","height":87});
															thumbnails[5372872] = clik.newPhoto({"id":5372872,"src":"ThePimp_thumb.jpg","galleries_id":302937,"server_id":15,"link":"photo_5372872.html","width":130,"caption":"The Pimp","height":200});
															thumbnails[7148558] = clik.newPhoto({"id":7148558,"src":"Halong_Bay-2_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148558.html","width":130,"caption":"Halong Bay-2","height":84});
															thumbnails[7148553] = clik.newPhoto({"id":7148553,"src":"General_Store_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148553.html","width":130,"caption":"General Store","height":81});
															thumbnails[7148152] = clik.newPhoto({"id":7148152,"src":"Having_a_Shave_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148152.html","width":130,"caption":"Having a Shave","height":156});
															thumbnails[7148533] = clik.newPhoto({"id":7148533,"src":"Clearing-the-path_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148533.html","width":130,"caption":"Clearing the path","height":195});
															thumbnails[7148580] = clik.newPhoto({"id":7148580,"src":"Lunchtime_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148580.html","width":130,"caption":"Lunchtime","height":195});
															thumbnails[7148568] = clik.newPhoto({"id":7148568,"src":"Imperial_CityHue_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148568.html","width":130,"caption":"Imperial City, Hue-1","height":87});
															thumbnails[7148564] = clik.newPhoto({"id":7148564,"src":"Imperial_CityHue-2_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148564.html","width":130,"caption":"Imperial City, Hue-2","height":203});
															thumbnails[7148565] = clik.newPhoto({"id":7148565,"src":"Imperial_CityHue-3_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148565.html","width":130,"caption":"Imperial City, Hue-3","height":84});
															thumbnails[7148896] = clik.newPhoto({"id":7148896,"src":"Time_for_a_snooze_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148896.html","width":130,"caption":"Time for a snooze","height":197});
															thumbnails[7148666] = clik.newPhoto({"id":7148666,"src":"Washday_Vietnam_Style_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148666.html","width":130,"caption":"Washday in Vietnam","height":87});
															thumbnails[7148662] = clik.newPhoto({"id":7148662,"src":"Sorting_the_recycling_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148662.html","width":130,"caption":"Sorting the recycling","height":84});
															thumbnails[7148658] = clik.newPhoto({"id":7148658,"src":"Saigon_Market_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148658.html","width":130,"caption":"Saigon Market","height":195});
															thumbnails[7148575] = clik.newPhoto({"id":7148575,"src":"Local_MarketMekong_Delta_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148575.html","width":130,"caption":"Local Market, Mekong Delta","height":87});
															thumbnails[7148539] = clik.newPhoto({"id":7148539,"src":"Cooking-Vietnamese_Style_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148539.html","width":130,"caption":"Cooking Vietnamese Style","height":87});
															thumbnails[7148669] = clik.newPhoto({"id":7148669,"src":"Staying_Afloat-Just_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148669.html","width":130,"caption":"Staying Afloat, Just!","height":70});
															thumbnails[7148151] = clik.newPhoto({"id":7148151,"src":"Drying-the-Washing_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7148151.html","width":130,"caption":"Drying the Washing","height":67});
															thumbnails[7152108] = clik.newPhoto({"id":7152108,"src":"Nha_Trang_Beach_thumb.jpg","galleries_id":386347,"server_id":15,"link":"photo_7152108.html","width":130,"caption":"Nha Trang Beach","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[235315] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"London Salon of Photography Acceptances","link":"gallery_235315.html","maxRecords":0.0,"photoIDs":[3872272.0,3931858.0],"skipIndex":0,"section_code":"gallery","featured_images":"3931858,3872272","id":235315,"singleSection":false});				  						galleries[13575] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"People","link":"gallery_13575.html","maxRecords":0.0,"photoIDs":[158950.0,3939512.0,4976895.0,8576298.0],"skipIndex":0,"section_code":"gallery","featured_images":4976895.0,"id":13575,"singleSection":false});				  						galleries[13574] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Brighton & Sussex","link":"gallery_13574.html","maxRecords":0.0,"photoIDs":[3939435.0,949049.0,2253688.0,2253691.0,3872024.0,3872256.0,3875097.0,3875142.0,3881619.0,3881623.0,146653.0,158937.0,151390.0,949050.0],"skipIndex":0,"section_code":"gallery","featured_images":"3939435,3881623,3881619,3875142,3872024,2253691,949050,949049","id":13574,"singleSection":false});				  						galleries[42033] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Lake District","link":"gallery_42033.html","maxRecords":0.0,"photoIDs":[5372848.0,5372857.0,5372862.0],"skipIndex":0,"section_code":"gallery","featured_images":"5372862,5372848","id":42033,"singleSection":false});				  						galleries[361659] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"London's Southbank","link":"gallery_361659.html","maxRecords":0.0,"photoIDs":[6599141.0,6599149.0,6599151.0,6599153.0],"skipIndex":0,"section_code":"gallery","featured_images":"6599153,6599151,6599141","id":361659,"singleSection":false});				  						galleries[361652] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Goodwood Vintage 2010","link":"gallery_361652.html","maxRecords":0.0,"photoIDs":[6574286.0,6598899.0,6598902.0,6598906.0,6598908.0,6598911.0,7152126.0,6598904.0],"skipIndex":0,"section_code":"gallery","featured_images":"7152126,6598911","id":361652,"singleSection":false});				  						galleries[13583] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Black & White","link":"gallery_13583.html","maxRecords":0.0,"photoIDs":[146711.0,3881563.0,3881627.0,8576303.0],"skipIndex":0,"section_code":"gallery","featured_images":"8576303,3881627,3881563","id":13583,"singleSection":false});				  						galleries[13577] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Travel Miscellaneous","link":"gallery_13577.html","maxRecords":0.0,"photoIDs":[150773.0,158652.0,158653.0,176897.0,949055.0,949060.0,949063.0,3875127.0,3875134.0,3875148.0,3881554.0,3890916.0,3890924.0,3939518.0,3939527.0,8577756.0,949052.0,949048.0,542059.0],"skipIndex":0,"section_code":"gallery","featured_images":"3939527,3890924,3890916,3875127,949060,949055,949052","id":13577,"singleSection":false});				  						galleries[236288] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Carnival Time in Venice","link":"gallery_236288.html","maxRecords":0.0,"photoIDs":[3890927.0,3939515.0,3939522.0],"skipIndex":0,"section_code":"gallery","featured_images":3890927.0,"id":236288,"singleSection":false});				  						galleries[236292] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Venice - general","link":"gallery_236292.html","maxRecords":0.0,"photoIDs":[146654.0,150760.0,150767.0,176893.0,176899.0,176901.0,309947.0,3881551.0,3939509.0],"skipIndex":0,"section_code":"gallery","featured_images":"3881551,309947","id":236292,"singleSection":false});				  						galleries[396119] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Courchevel\/La Tania","link":"gallery_396119.html","maxRecords":0.0,"photoIDs":[7321924.0,7321933.0,7321926.0,7321930.0,7321935.0,7321937.0,7321938.0,7321939.0,7321940.0,7321941.0,7321942.0,7321943.0],"skipIndex":0,"section_code":"gallery","featured_images":"7321941,7321939,7321926,7321924","id":396119,"singleSection":false});				  						galleries[302937] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cuba","link":"gallery_302937.html","maxRecords":0.0,"photoIDs":[6563329.0,5372879.0,6563335.0,6563375.0,5372876.0,6563353.0,6563374.0,5372872.0],"skipIndex":0,"section_code":"gallery","featured_images":"6563375,6563353,6563335,6563329,5372876","id":302937,"singleSection":false});				  						galleries[386347] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Vietnam 2010","link":"gallery_386347.html","maxRecords":0.0,"photoIDs":[8576302.0,7148589.0,7148613.0,7148615.0,7148606.0,7148617.0,7148592.0,7148595.0,7148164.0,7148600.0,7148556.0,7148542.0,7148544.0,7148557.0,7148561.0,7148562.0,7148809.0,7148558.0,7148553.0,7148152.0,7148533.0,7148580.0,7148568.0,7148564.0,7148565.0,7148896.0,7148666.0,7148662.0,7148658.0,7148575.0,7148539.0,7148669.0,7148151.0,7152108.0],"skipIndex":0,"section_code":"gallery","featured_images":"7152108,7148615,7148606,7148589,7148580,7148568,7148561,7148558,7148557,7148556,7148544,7148542,7148164","id":386347,"singleSection":false});				  						galleries[453491] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Architecture","link":"gallery_453491.html","maxRecords":0.0,"photoIDs":[6599143.0,8577753.0,8577757.0],"skipIndex":0,"section_code":"gallery","featured_images":"8577757,8577753,6599143","id":453491,"singleSection":false});				  						galleries[361671] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Miscellaneous","link":"gallery_361671.html","maxRecords":0.0,"photoIDs":[2153055.0,2153100.0,2253695.0,3875123.0,3881567.0,3939521.0,8576307.0],"skipIndex":0,"section_code":"gallery","featured_images":"8576307,3875123","id":361671,"singleSection":false});				  						galleries[19785] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"LRPS Panel","link":"gallery_19785.html","maxRecords":0.0,"photoIDs":[217885.0],"skipIndex":0,"section_code":"gallery","featured_images":217885.0,"id":19785,"singleSection":false});				  						galleries[282837] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ARPS Panel","link":"gallery_282837.html","maxRecords":0.0,"photoIDs":[4978130.0],"skipIndex":0,"section_code":"gallery","featured_images":4978130.0,"id":282837,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8576303,8576298,6599151,5372848,4978130,4976895,3939527,3939522,3939521,3939518,3939515,3939512,3939435,3931858,3890927,3890924,3890916,3881623,3881567,3881563,3881554,3881551,3875134,3875123,3872272,3872256,2253695,309947,7321924,7152126,7148589,949052,146653,7329132,158937,7321926,7148615,7148606,949050,7321939,7148164,7321941,6563329,7148542,5372879,7148544,6563335,7148557,6563375,7148561,5372876';
imageSets[2] = '8576307,8576303,6599153,6599151,6599141,6598911,5372862,5372848,4978130,4976895,3939527,3939435,3931858,3890927,3890924,3890916,3881627,3881623,3881619,3881563,3881551,3875142,3875127,3875123,3872272,3872024,2253691,949060,949055,949049,309947,7321924,7152126,7148589,949052,7329132,7321926,7148615,7148606,949050,7321939,7148164,7321941,7148556,6563329,7148542,7148544,6563335,7148557,6563375,7148561,5372876,6563353,7148558,7148580,7148568,7152108';
imageSets[3] = '8577757,8577756,8577753,8576307,8576303,8576302,8576298,7329132,7321943,7321942,7321941,7321940,7321939,7321938,7321937,7321935,7321933,7321930,7321926,7321924,7152126,7152108,7148896,7148809,7148669,7148666,7148662,7148658,7148617,7148615,7148613,7148606,7148600,7148595,7148592,7148589,7148580,7148575,7148568,7148565,7148564,7148562,7148561,7148558,7148557,7148556,7148553,7148544,7148542,7148539';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/maggit/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/maggit/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/maggit/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/maggit/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/maggit/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/maggit/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/maggit/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 = 'Maggi Tillotson 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;
	}
}

			

