function thumbnail(g,e,b,f,d,a,c){this.id=g;this.galleries_id=e;this.caption=b;this.src=getServerPath(c)+"/"+f;this.width=d;this.height=a}function gallery(e,c,d,b,a){this.id=e;this.featured_images=c;this.title=d;this.section_code=b;this.photoIDs=a}var thumbnails=new Object();thumbnails[3894438]=new thumbnail(3894438,"236495","Damselfly larva - darkfield lighting","damselfly_larva_thumb.jpg",130,74,18);thumbnails[3894458]=new thumbnail(3894458,"236495","Mating Flies","flies_thumb.jpg",130,93,18);thumbnails[3894567]=new thumbnail(3894567,"236495","Fossilised fly in amber","fly_in_amber_thumb.jpg",130,94,18);thumbnails[3894584]=new thumbnail(3894584,"236495","Strelitzia reginae","focus_stack_thumb.jpg",130,85,18);thumbnails[3894588]=new thumbnail(3894588,"236495","Fossil Crinoid","fossil_crinoid_thumb.jpg",130,105,18);thumbnails[3894591]=new thumbnail(3894591,"236495","Fossil Fish","fossil_fish_thumb.jpg",130,87,18);thumbnails[3894647]=new thumbnail(3894647,"236495","Queen Angelfish","Queen_Angelfish_thumb.jpg",130,114,18);thumbnails[3894655]=new thumbnail(3894655,"236495","Time-lapse image composed from two images of Daffodil opning over a period of 12 hours","time-lapse_thumb.jpg",130,195,18);thumbnails[3894659]=new thumbnail(3894659,"236495","Tree Frog in the Corkscrew Swamp Sanctuary, Florida. Shot with equivalent of 500mm lens.","tree_frog_thumb.jpg",130,195,18);thumbnails[3894663]=new thumbnail(3894663,"236495","Fairy Shrimp: Triops cancriformis","Triops_cancriformis_thumb.jpg",130,86,18);thumbnails[3894680]=new thumbnail(3894680,"236495","Triops cancriformis - darkfield lighting","triops_final_thumb.jpg",130,194,18);thumbnails[3909451]=new thumbnail(3909451,"236495","Bleeding Hearst Test at 500","dicentra_2_thumb.jpg",130,195,18);thumbnails[3935963]=new thumbnail(3935963,"236495","Ammonite section","ammonite_2_thumb.jpg",130,152,18);thumbnails[3935965]=new thumbnail(3935965,"236495","Brillantaisia","brillantaisia_2_thumb.jpg",130,195,18);thumbnails[3935968]=new thumbnail(3935968,"236495","Dental drill photographed at X 5 magnification","dental_drill1_thumb.jpg",130,214,18);thumbnails[3935969]=new thumbnail(3935969,"236495","Hedgehog spines","Hedgehog_spines_2_thumb.jpg",130,194,18);thumbnails[3935971]=new thumbnail(3935971,"236495","Larvae of Horse Chestnut leaf miner moth","horse_chestnut_larvae_2_thumb.jpg",130,122,18);thumbnails[3935972]=new thumbnail(3935972,"236495","Tip of hypodermic needle","hypodermic_2_thumb.jpg",130,195,18);thumbnails[3935973]=new thumbnail(3935973,"236495","Plastic syringe taken through  cross polarised filters","polarised_2_thumb.jpg",130,195,18);thumbnails[3935975]=new thumbnail(3935975,"236495","Pollen being dispersed from Pendulous Sedge","sedge_pollen_2_thumb.jpg",130,190,18);thumbnails[3935977]=new thumbnail(3935977,"236495","Seed pod of Bristly Fruited Silkweed, Sardinia.","silkweed_2_thumb.jpg",130,196,18);thumbnails[4252524]=new thumbnail(4252524,"236495","Eggs of Lareg White Butterfly laid on Cabbage leaf","butterfly_eggs_thumb.jpg",130,96,18);thumbnails[4253541]=new thumbnail(4253541,"236495",'Series showing development of "pitcher" on Insectivorous plant Nepenthes elata',"nepenthes_growth_thumb.jpg",130,86,18);thumbnails[4595425]=new thumbnail(4595425,"236495",'Wing of Marsh Fritillary butterfly ("focus stacked" from 3 images',"marsh_fritillary_wing_thumb.jpg",130,194,18);thumbnails[3909474]=new thumbnail(3909474,"236495","cover ","cover_test_500_thumb.jpg",130,169,18);thumbnails[592832]=new thumbnail(592832,"45490","Grey Seal (Halichoerus grypus) Pup. Donna Nook, Lincolnshire, England","seal pup_thumb.jpg",130,81,18);thumbnails[592837]=new thumbnail(592837,"45490","Grey Seal (Halichoerus grypus) Mother with pup. Donna Nook, Lincolnshire, England","Grey Seal_thumb.jpg",130,82,18);thumbnails[592840]=new thumbnail(592840,"45490","Otter (Lutra lutra)","otter_thumb.jpg",130,165,18);thumbnails[592856]=new thumbnail(592856,"45490","Roe Deer (Capreolus capreolus) buck. Surrey, England","roe deer_thumb.jpg",130,194,18);thumbnails[593163]=new thumbnail(593163,"45490","Fox (Vulpes vulpes)","fox_thumb.jpg",130,87,18);thumbnails[593723]=new thumbnail(593723,"45490","Badger (Meles meles) Devon, England","badger_thumb.jpg",130,88,18);thumbnails[594750]=new thumbnail(594750,"45490","Roe Deer (Capreolus capreolus) Surrey, England","roedeer2_thumb.jpg",130,90,18);thumbnails[594825]=new thumbnail(594825,"45490","Scottish Wild Cat (Felis catus)","wildcat_thumb.jpg",130,160,18);thumbnails[1588927]=new thumbnail(1588927,"45490","Fox yawning","Fox-yawn-final_thumb.jpg",130,194,18);thumbnails[3936330]=new thumbnail(3936330,"45490","Common Weasel.","weasel_thumb.jpg",130,88,18);thumbnails[593172]=new thumbnail(593172,"45484","Osprey (Pandion haliaetus) Everglades, Florida","osprey_thumb.jpg",130,187,18);thumbnails[593725]=new thumbnail(593725,"45484","Barn Owl (Tyto alba)","barnowl_thumb.jpg",130,185,18);thumbnails[593740]=new thumbnail(593740,"45484","Greater Spotted Woodpecker (Dendrocopos major)<br>\r\nSurrey, England","woodpecker_thumb.jpg",130,190,18);thumbnails[594740]=new thumbnail(594740,"45484","Anhinga, or Snake-Bird (Anhinga anhinga) drying its' wings.  Everglades, Florida","anhinga_thumb.jpg",130,156,18);thumbnails[594746]=new thumbnail(594746,"45484","Little Blue Heron (Egretta caerulea)  Sunrise, Everglades, Florida","blueheron_thumb.jpg",130,200,18);thumbnails[594822]=new thumbnail(594822,"45484","Redshank (Tringa totanus)  Suffolk, England","redshank_thumb.jpg",130,181,18);thumbnails[595448]=new thumbnail(595448,"45484","Grey Heron (Ardea cinerea) amongst Yellow Water Lilies - Surrey, England","greyheron_thumb.jpg",130,191,18);thumbnails[1588929]=new thumbnail(1588929,"45484","Grey Heron","grey-heron_thumb.jpg",130,160,18);thumbnails[4259361]=new thumbnail(4259361,"45484","White Pelicans, Ding Darling Nature Reserve, Florida","pelicans_thumb.jpg",130,86,18);thumbnails[4259368]=new thumbnail(4259368,"45484","Burrowing Owl, Cape Coral, Florida","burrowing_owl_thumb.jpg",130,196,18);thumbnails[593156]=new thumbnail(593156,"45485","Broad Bodied Chaser Dragonfly (Libellua depresa)  Male. Surrey, England.","dragonfly_thumb.jpg",130,166,18);thumbnails[593167]=new thumbnail(593167,"45485","Marsh Fritillary Butterfly (Eurodryas aurinia)","MarshFrit_thumb.jpg",130,167,18);thumbnails[593177]=new thumbnail(593177,"45485","The Imperial or Emperor Scorpion (Pandinus imperator) fluorescing in ultraviolet light.","uvscorpion_thumb.jpg",130,87,18);thumbnails[594753]=new thumbnail(594753,"45485","Swallowtail Butterfly (Papilio machaon)","swallowtail_thumb.jpg",130,173,18);thumbnails[594809]=new thumbnail(594809,"45485","Emperor Moth (Saturnia pavonia) Male - antennae used to detect scent of female. Surrey, England.","empmoth_thumb.jpg",130,102,18);thumbnails[594823]=new thumbnail(594823,"45485","Wasp Spider (Argiope bruennichi) Wetland Centre, Barnes, London, 2006","waspspider_thumb.jpg",130,188,18);thumbnails[595464]=new thumbnail(595464,"45485","Oak Bush Cricket (Meconema thalassinum) Devon, England","bushcricket_thumb.jpg",130,150,18);thumbnails[597088]=new thumbnail(597088,"45485","Painted Lady Buterfly (Cynthia cardui) Devon, England","paintedlady_thumb.jpg",130,194,18);thumbnails[4590495]=new thumbnail(4590495,"45485","Newly emerged 6 Spot Burnet moth, showing pupal case","6_spot_burnet_moth_thumb.jpg",130,86,18);thumbnails[4590503]=new thumbnail(4590503,"45485","Tropical butterfly: Charaxes sp.","charaxes_2_thumb.jpg",130,196,18);thumbnails[4590521]=new thumbnail(4590521,"45485","Common Blue butterflies mating","common_blue_2_thumb.jpg",130,183,18);thumbnails[4590527]=new thumbnail(4590527,"45485","Drinker Moth: male and female","drinker_moth_pair_thumb.jpg",130,185,18);thumbnails[4590531]=new thumbnail(4590531,"45485","Golden-Ringed Dragonfly: close-up of head","golden_ringed_dragonfly_5_thumb.jpg",130,193,18);thumbnails[4590540]=new thumbnail(4590540,"45485","Mermaid's Purse: egg case of Ray, amongst lichens on beach","mermaids_purse_1_thumb.jpg",130,86,18);thumbnails[4590595]=new thumbnail(4590595,"45485","Flies on, and flying towards cow's face","flies_on_cow_thumb.jpg",130,103,18);thumbnails[592825]=new thumbnail(592825,"45491","Palm Leaf, Eden Project, Cornwall","palm leaf_thumb.jpg",130,168,18);thumbnails[592852]=new thumbnail(592852,"45491","Insectivorous Pitcher Plant (Sarracenia purpurea ssp. venosa)","pitcher plant_thumb.jpg",130,171,18);thumbnails[593153]=new thumbnail(593153,"45491","Bristlecone Pine (Pinus longaeva) Oldest Trees on Earth, White Mountains, Eastern California, USA","bristlecone_thumb.jpg",130,195,18);thumbnails[593165]=new thumbnail(593165,"45491","Fritillary (Fritillaria meleagris)","fritillary_thumb.jpg",130,195,18);thumbnails[593735]=new thumbnail(593735,"45491",'Backlit Rhododendron leaf ("Temple Belle" group")',"rhodoleaf_thumb.jpg",130,97,18);thumbnails[593737]=new thumbnail(593737,"45491","Stinging Nettle (Urtica dioica) ","stingnettle_thumb.jpg",130,196,18);thumbnails[594812]=new thumbnail(594812,"45491","Cross section through Loofah (Luffa aegyptiaca) - showing vascular structure","loofah_thumb.jpg",130,130,18);thumbnails[594817]=new thumbnail(594817,"45491","Cactus (Notocactus leninghausii) flower","notocactus_thumb.jpg",130,174,18);thumbnails[594821]=new thumbnail(594821,"45491","King Protea (Protea cynaroides)","protea_thumb.jpg",130,135,18);thumbnails[595359]=new thumbnail(595359,"45491","Dog Rose (Rosa canina) Surrey, England","dogrose_thumb.jpg",130,91,18);thumbnails[595407]=new thumbnail(595407,"45491","The Fetzer Vineyard show garden - Chelsea Flower Show, 2005","Fetzer_thumb.jpg",130,86,18);thumbnails[595445]=new thumbnail(595445,"45491","Gazania krebsiana - Eden Project, Cornwall","Gazaniakrebsiana_thumb.jpg",130,194,18);thumbnails[1588931]=new thumbnail(1588931,"45491","Rosebay Willowherb (Fireweed) growing on burnt heathland","willowherb_thumb.jpg",130,194,18);thumbnails[3936329]=new thumbnail(3936329,"45491","Monkey Orchid, Oxfordshire, 2009","Monkey_Orchid_thumb.jpg",130,196,18);thumbnails[4595419]=new thumbnail(4595419,"45491","Plants will always find a place to grow! Ivy on a wall in Hampstead, London","ivy_in_wall_thumb.jpg",130,194,18);thumbnails[593727]=new thumbnail(593727,"45486","Fly Agaric Toadstools (Amanita muscaria) in Birch woodland, Epping Forest, Essex","flyagaric_thumb.jpg",130,176,18);thumbnails[593730]=new thumbnail(593730,"45486","Porcelain Fungus (Oudemansiella mucida) Beech woodland, Surrey, England","porcelainfungus_thumb.jpg",130,93,18);thumbnails[593733]=new thumbnail(593733,"45486","Puffball fungus (Lycoperdon perlatum) Discharging spores following strike from water drop.","puffball_thumb.jpg",130,178,18);thumbnails[594803]=new thumbnail(594803,"45486","Chestnut Parasol (Lepiota castanea) Cap detail. Surrey, England.","chestnutparasol_thumb.jpg",130,103,18);thumbnails[594819]=new thumbnail(594819,"45486","Liverwort (Pellia epiphylla) Dartmoor, England","Pellia_thumb.jpg",130,194,18);thumbnails[594830]=new thumbnail(594830,"45486","Yellow Antler Fungus (Calocera viscosa)","yellowantler_thumb.jpg",130,191,18);thumbnails[595452]=new thumbnail(595452,"45486","Honey Fungus (Armillaria mellea) Surrey, England","honeyfungus_thumb.jpg",130,186,18);thumbnails[595455]=new thumbnail(595455,"45486","Fungus (Laccaria proxima) Dartmoor, England","Laccariaproxima_thumb.jpg",130,194,18);thumbnails[1588942]=new thumbnail(1588942,"45486","Brown Rot fungus on Cox Apple","Brown-Rot-Fungus_thumb.jpg",130,194,18);thumbnails[1609832]=new thumbnail(1609832,"45486","Earthstar Fungus (Geastrum triplex)","earthstar_thumb.jpg",130,87,18);thumbnails[1609835]=new thumbnail(1609835,"45486","Earthstar fungus (Geastrum triplex) discharging spores","earthstar-spores_thumb.jpg",130,194,18);thumbnails[4590564]=new thumbnail(4590564,"45486","Tawny Grisette fungus.","Tawny_Grisette_thumb.jpg",130,196,18);thumbnails[593717]=new thumbnail(593717,"45487","Adder (Vipera berus) Sussex, England","adder1_thumb.jpg",130,84,18);thumbnails[593719]=new thumbnail(593719,"45487","Adder (Vipera berus) Sussex, England","adder2_thumb.jpg",130,201,18);thumbnails[593739]=new thumbnail(593739,"45487","Toad (Bufo bufo) in garden.","toad_thumb.jpg",130,165,18);thumbnails[594736]=new thumbnail(594736,"45487","Alligator (Alligator mississippiensis)  Everglades, Florida","alligator_thumb.jpg",130,84,18);thumbnails[594737]=new thumbnail(594737,"45487","Alligator (Alligator mississippiensis) with young. Everglades, Florida","gatorandyoung_thumb.jpg",130,87,18);thumbnails[594748]=new thumbnail(594748,"45487","American Crocodile (Crocodylus acutus)  Everglades, Florida","crocodile_thumb.jpg",130,85,18);thumbnails[594815]=new thumbnail(594815,"45487","Common Newt (Triturus vulgaris)Male.","newt_thumb.jpg",130,81,18);thumbnails[1588935]=new thumbnail(1588935,"45487","Grass Snake hunting on edge of pond","grass-snake_thumb.jpg",130,174,18);thumbnails[592847]=new thumbnail(592847,"45488","Parrot Feather (","parrots feather_thumb.jpg",130,195,18);thumbnails[593151]=new thumbnail(593151,"45488","Water Fern (Azolla filicoides) ","azolla_thumb.jpg",130,87,18);thumbnails[593168]=new thumbnail(593168,"45488","Mono Lake, California","monolake_thumb.jpg",130,87,18);thumbnails[593174]=new thumbnail(593174,"45488","Sunrise, Everglades, Florida","sunrise_thumb.jpg",130,85,18);thumbnails[593175]=new thumbnail(593175,"45488","Birch seedlings appearing just two weeks after a devastating fire on Thursley Common National Nature Reserve, Surrey, 2006","Thursleyfire_thumb.jpg",130,195,18);thumbnails[593736]=new thumbnail(593736,"45488","Inversnaid Bur, Inversnaid near Loch Lomond, Scotland","snaidburn_thumb.jpg",130,36,18);thumbnails[594745]=new thumbnail(594745,"45488","Beechwood (Fagus sylvatica) Sunrise. Epping Forest, Essex, ","beechwood_thumb.jpg",130,129,18);thumbnails[594805]=new thumbnail(594805,"45488","Dried up stream bed, Sussex, 2006","drought_thumb.jpg",130,194,18);thumbnails[594810]=new thumbnail(594810,"45488","Horse Chestnut Leaf Miner (Cameraria ohridella) A leaf mining moth which first appeared in 2003","leafminer_thumb.jpg",130,97,18);thumbnails[597085]=new thumbnail(597085,"45488","Danger sign at Slapton Ley National Nature Reserve, 2006 - toxic algae","slaptonsign_thumb.jpg",130,106,18);thumbnails[3936253]=new thumbnail(3936253,"45488","Burnt out car in Surrey Bluebell Wood","bluebell_and_car_thumb.jpg",130,86,18);thumbnails[3936324]=new thumbnail(3936324,"45488","Traditional Haystacks, County Mayo, Ireland. 2008","corn_stook_thumb.jpg",130,194,18);thumbnails[3936337]=new thumbnail(3936337,"45488","Madagascar Periwinkle. Used in treatment of Leukaemia. ","periwinkle_thumb.jpg",130,196,18);thumbnails[4259373]=new thumbnail(4259373,"45488","Corkscrew Swamp, Florida. Note Cypress pollen on water surface","corkscrew_swamp_thumb.jpg",130,86,18);thumbnails[4590551]=new thumbnail(4590551,"45488","Working salt-pan in Lanzarote, Canary Islands","salt_3_thumb.jpg",130,196,18);thumbnails[4590558]=new thumbnail(4590558,"45488","Vineyard in Lanzarote, Canary Islands","vineyard_1_thumb.jpg",130,85,18);thumbnails[4595420]=new thumbnail(4595420,"45488","Dried lizards for sale in a herbal medicine market, Hong Kong","lizards_3_thumb.jpg",130,87,18);thumbnails[4595439]=new thumbnail(4595439,"45488","Moss Campion growing in Cwm Idwal, Snowdonia, Wales ","moss_campion_thumb.jpg",130,86,18);thumbnails[4595440]=new thumbnail(4595440,"45488","Peat bog with ancient bog oak revealed by peat cutting. Achill Island, County Mayo, Ireland","peat_bog_5_thumb.jpg",130,194,18);thumbnails[4595441]=new thumbnail(4595441,"45488","The alga Trentepohlia, growing on an oak trunk, in a Surrey Bluebell wood","Trentepohlia_thumb.jpg",130,86,18);thumbnails[1583326]=new thumbnail(1583326,"108179","Alpha male","snow-monkey-1_thumb.jpg",130,194,18);thumbnails[1583335]=new thumbnail(1583335,"108179","Huddling together for warmth","snow-monkey-2_thumb.jpg",130,194,18);thumbnails[1583340]=new thumbnail(1583340,"108179","Dozing!","snow-monkey-3_thumb.jpg",130,87,18);thumbnails[1583345]=new thumbnail(1583345,"108179","","snow-monkey-4_thumb.jpg",130,194,18);thumbnails[1583347]=new thumbnail(1583347,"108179","Steam rising from thermal pool","snow-monkey-5_thumb.jpg",130,87,18);thumbnails[1583350]=new thumbnail(1583350,"108179","Female in water","snow-monkey-6_thumb.jpg",130,194,18);thumbnails[1583352]=new thumbnail(1583352,"108179","Adult grooming youngster","snow-monkey-7_thumb.jpg",130,87,18);thumbnails[1583358]=new thumbnail(1583358,"108179","Snow Monkey with photographer!","AD-monkey_thumb.jpg",130,86,18);var galleries=new Object();galleries[236495]=new gallery(236495,"3909474","NEW - Digital Macro Book","gallery",[3894438,3894458,3894567,3894584,3894588,3894591,3894647,3894655,3894659,3894663,3894680,3909451,3935963,3935965,3935968,3935969,3935971,3935972,3935973,3935975,3935977,4252524,4253541,4595425,3909474]);galleries[45490]=new gallery(45490,"1588927,594825,593723,593163","Mammals","gallery",[592832,592837,592840,592856,593163,593723,594750,594825,1588927,3936330]);galleries[45484]=new gallery(45484,"1588929,595448,594822,594746,593725,593172","Birds","gallery",[593172,593725,593740,594740,594746,594822,595448,1588929,4259361,4259368]);galleries[45485]=new gallery(45485,"595464,594823,594809,594753,593167,593156","Insects & Invertebrates","gallery",[593156,593167,593177,594753,594809,594823,595464,597088,4590495,4590503,4590521,4590527,4590531,4590540,4590595]);galleries[45491]=new gallery(45491,"595407,594821,594817,594812,593165,592825","Flowering Plants","gallery",[592825,592852,593153,593165,593735,593737,594812,594817,594821,595359,595407,595445,1588931,3936329,4595419]);galleries[45486]=new gallery(45486,"1609835,1609832,595455,595452,594803,593733,593730,593727","Flowerless Plants","gallery",[593727,593730,593733,594803,594819,594830,595452,595455,1588942,1609832,1609835,4590564]);galleries[45487]=new gallery(45487,"594748,593739,593719,593717","Amphibians & Reptiles","gallery",[593717,593719,593739,594736,594737,594748,594815,1588935]);galleries[45488]=new gallery(45488,"3936253,594810,594805,594745,593736,593174","Environment","gallery",[592847,593151,593168,593174,593175,593736,594745,594805,594810,597085,3936253,3936324,3936337,4259373,4590551,4590558,4595420,4595439,4595440,4595441]);galleries[108179]=new gallery(108179,"1583335,1583326","Japanese Snow Monkeys","gallery",[1583326,1583335,1583340,1583345,1583347,1583350,1583352,1583358]);var imageSets=new Object();imageSets[1]="3909474,3894438";imageSets[2]="3936253,3909474,1609835,1609832,1588929,1588927,1583335,1583326,595464,595455,595452,595448,595407,594825,594823,594822,594821,594817,594812,594810,594809,594805,594803,594753,594748,594746,594745,593739,593736,593733,593730,593727,593725,593723,593719,593717,593174,593172,593167,593165,593163,593156,592825";imageSets[3]="4595441,4595440,4595439,4595425,4595420,4595419,4590595,4590564,4590558,4590551,4590540,4590531,4590527,4590521,4590503,4590495,4259373,4259368,4259361,4253541,4252524,3936337,3936330,3936329,3936324,3936253,3935977,3935975,3935973,3935972,3935971,3935969,3935968,3935965,3935963,3909474,3909451,3894680,3894663,3894659,3894655,3894647,3894591,3894588,3894584,3894567,3894458,3894438,1609835,1609832";function randomListVal(a){arrayVals=a.split(",");if(arrayVals.length){pos=Math.round(Math.random()*(arrayVals.length-1));val=arrayVals[pos]}else{val=0}return val}function getServerPath(a){var b=-1;switch(a){case 21:b="http://www6.clikpic.com/adavies/images";break}switch(a){case 1:b="http://www1.clikpic.com/adavies/images";break}switch(a){case 2:b="http://admin.clikpic.com/adavies/images";break}switch(a){case 24:b="http://tpc15/clikpic/adavies/images";break}switch(a){case 4:b="http://www.clikchurch.com/adavies/images";break}switch(a){case 5:b="http://www2.clikpic.com/adavies/images";break}switch(a){case 22:b="http://tpc5/clikpic/adavies/images";break}switch(a){case 23:b="http://tpc10/clikpic/adavies/images";break}switch(a){case 25:b="http://tpc16/clikpic/adavies/images";break}switch(a){case 15:b="http://www3.clikpic.com/adavies/images";break}switch(a){case 18:b="http://www4.clikpic.com/adavies/images";break}switch(a){case 19:b="http://www5.clikpic.com/adavies/images";break}switch(a){case 31:b="http://www7.clikpic.com/adavies/images";break}switch(a){case 32:b="http://admin2.clikpic.com/adavies/images";break}switch(a){case 33:b="http://www8.clikpic.com/adavies/images";break}switch(a){case 34:b="http://www9.clikpic.com/adavies/images";break}switch(a){case 35:b="http://admin3.clikpic.com/adavies/images";break}switch(a){case 37:b="http://admin4.clikpic.com/adavies/images";break}return b}function showHomeImage(a){imageID=randomListVal("");if(!basic){a.src=photos[imageID].src;a.width=photos[imageID].width;a.height=photos[imageID].height}else{newImage=new Image(photos[imageID].width,photos[imageID].height);newImage.src=photos[imageID].src;document.images[a.name]=newImage}}function showHomeImageInline(){html="";imageID=randomListVal(imageSets[1]);if("gallery"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="gallery.html">'}}html+='<img src="'+backgrounds[imageID].src+'" width="'+backgrounds[imageID].width+'" height="'+backgrounds[imageID].height+'" class="mainhomepageimage photo" id="mainSample" name="mainSample" alt="'+escape(backgrounds[imageID].caption)+'" border="0">';if("gallery"!=""){html+="</a>"}$("#homepageimage").html(html)}function getNextId(b,d,a){var c=getArrayPos(d,b);if(a){if(c==0){nextImgPos=d.length-1}else{nextImgPos=c-1}}else{if(c==d.length-1){nextImgPos=0}else{nextImgPos=c+1}}nextImg=d[nextImgPos];return nextImg}function next(d,b){var c=d.value;var a=galleries[photos[c].galleries_id].photoIDs;nextImg=getNextId(c,a);if(nextImg!=-1){updateImage(nextImg,d,b)}}function updateImage(f,e,b){if(!basic){document.getElementById("imagePhoto").innerHTML='<img class="mainphoto photo" src="'+photos[f].src+' " id="mainPic" name="mainPic" width="'+photos[f].width+'" height="'+photos[f].height+'" alt="'+photos[f].caption+'">';e.value=photos[f].id;$("#imageTitle").html(photos[f].caption);document.title="Adrian Davies Imaging: "+photos[f].caption;if(photos[f].caption==""){document.getElementById("imageTitle").style.display="none"}else{document.getElementById("imageTitle").style.display="block"}var a=fnGetImageDetails(f);if(a==""){document.getElementById("imageDetails").style.display="none";var c=document.getElementById("infoWrap");var d=document.getElementById("photoInfo");if(photos[f].caption==""){if(c!=null){c.className="empty"}if(d!=null){d.className="empty"}}else{if(c!=null){c.className="noinfo"}if(d!=null){d.className="noinfo"}}}else{document.getElementById("imageDetails").style.display="block";var c=document.getElementById("infoWrap");if(c!=null){c.className="normal"}var d=document.getElementById("photoInfo");if(d!=null){d.className="normal"}}document.getElementById("imageDetails").innerHTML=a;toggleAddToCartConfirm()}else{window.location="photo_"+photos[f].id+".html"}}function toggleAddToCartConfirm(){if($("#paymentConfirm").size()){$("#paymentConfirm").hide();$("#paymentAddButton").unbind().click(function(){form=document.getElementById("paymentForm");option_id=0;if(form.item_option.value){option_id=form.item_option.value}if(addItemToBasket(form.item_number.value,photos,form.site.value,parseInt(form.quantity.value,10),option_id)){if($.browser.msie){$("#paymentConfirm").text("Item added to cart").show()}else{$("#paymentConfirm").text("Item added to cart").fadeIn()}}else{$("#paymentConfirm").text("Item not added - check cookies are enabled in your browser.").fadeIn()}})}}function fnGetImageDetails(b){var a="";if(photos[b].description!=""){a=a+'<p id="imageDescription">'+photos[b].description+"</p>"}if(photos[b].photo_ref!=""){a=a+'<p class="imageinfo" id="imageRef"><strong>Ref: </strong>'+photos[b].photo_ref+"</p>"}if(photos[b].takendate!=""){a=a+'<p class="imageinfo" id="imageDate"><strong>Date: </strong>'+photos[b].takendate+"</p>"}if(photos[b].location!=""){a=a+'<p class="imageinfo" id="imageLocation"><strong>Location: </strong>'+photos[b].location+"</p>"}if(photos[b].photographer!=""){a=a+'<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>'+photos[b].photographer+"</p>"}if(a!=""){a=a+'<div class="spacer"></div>'}return a}function fnGetPaymentInfo(c){var b="";if(c.item_price!==""){b=b+"<p>Order this print:</p>";b=b+'<p class="imageinfo" id="imagePrice"><strong>'+c.purchase_instruction+"</strong> 							"+(c.item_price).toFixed(2)+"</p>";var e=c.purchase_instruction;var d=(c.item_price).toFixed(2);var a=0}else{if(c.payment_groups_id!==""){b=b+"<p>Buy this print online:</p>";b=b+'<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';b=b+'<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';b=b+getPaymentOptions(c.payment_groups_id);b=b+"</select>";b=b+"</form>";var a=paymentGroups[c.payment_groups_id].options[0];if(paymentOptions[a]){var e=paymentOptions[a].payment_option;var d=paymentOptions[a].price}}else{}}if(c.item_price!==""||c.payment_groups_id!==""){b=b+'<div class="clearing">&nbsp;</div>'}return b}function previous(d,b){var c=d.value;var a=galleries[photos[c].galleries_id].photoIDs;nextImg=getNextId(c,a,1);if(nextImg!=-1){updateImage(nextImg,d,b)}}function showGalleryImage(c,b){imageID=randomListVal(galleries[c].featured_images);if(imageID!=0){b.src=thumbnails[imageID].src;b.width=thumbnails[imageID].width;b.height=thumbnails[imageID].height;if(b.width<130){var f=$("img#gallery"+c);f.parents(".thumbWrap").width(b.width);var a=f.siblings("h3").size()==1?f.siblings("h3"):f.parent(".thumbWrap").siblings("h3");var g=parseInt(a.css("padding-left"))+parseInt(a.css("padding-right"));var d=parseInt(a.css("border-left-width"))+parseInt(a.css("border-right-width"));var e=parseInt(f.parents(".thumbWrap").css("border-left-width"))+parseInt(f.parents(".thumbWrap").css("border-right-width"));a.width(f.outerWidth(true)-g-d+e)}}}function showGalleries(a){if(!basic){temp="";for(i=0;i<galleries.length;i++){if(galleries[i].id!=a){if(temp!=""){temp=temp+" | "}temp=temp+'<a href="gallery_'+galleries[i].id+'.html">'+galleries[i].title+"</a>"}}document.all.galleryLinks.innerHTML="Other galleries: "+temp}}function resizePhotoInfo(n){var b=$.extend({centre:false},n||{});var d=3;$("div#photoPanelOuter").height("auto");$("div#infoWrap").width(200);$("div#photoDetail").css("width","auto");var h=$("div#maincolContent").width();var j=$("div#photoWrap").outerWidth(true);var m=$("div#infoWrap").outerWidth(true);var k=$("div#photoWrap").outerHeight();var f=$("div#infoWrap").outerHeight();var c=$("div#infoWrap").hasClass("empty");floatDrop=0;var g=j;if(!c){if(h<(j+m)){floatDrop=1}if(!floatDrop){var a=$("div#infoWrap").innerWidth();$("div#infoWrap").width(a+(h-j-m-d));m=$("div#infoWrap").outerWidth(true);g=j+m;if(k>f){var e=$("div#photoPanelOuter").height();$("div#photoPanelOuter").height(e+(k-f));var f=$("div#infoWrap").outerHeight()}}else{var l=$("div#photoWrap").outerWidth();$("div#infoWrap").width(l)}}if(b.centre){$("div#photoDetail").width(g);$("div#photoDetail").css("margin-left","auto");$("div#photoDetail").css("margin-right","auto")}else{$("div#photoDetail").css("margin-left","0");$("div#photoDetail").css("margin-right","0")}}function getArrayPos(c,b){for(var a=0;a<c.length;a++){if(c[a]==b){return a}}return -1}function changeBgImg(a,e){var c=randomListVal(imageSets[e]);var d=backgrounds[c].src;var b=$(a);if(b.size()>0){if(/\bimg$/.test(a)){b.attr({src:d})}else{b.css({"background-image":'url("'+d+'")'})}}};