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[5438583]=new thumbnail(5438583,"307470","Bluebells Holwell Lawn<br>\r\n","Bbells_Holwell_path_to_qhaytor_thumb.jpg",130,87,5);thumbnails[5438595]=new thumbnail(5438595,"307470","Bluebells Dunsford woods","Bbells_Dunsford_under_tree_thumb.jpg",130,87,5);thumbnails[5450163]=new thumbnail(5450163,"307470","Bluebells Emsworthy","Bbells_Emsworthy36e_thumb.JPG",130,87,5);thumbnails[5450175]=new thumbnail(5450175,"307470","Bluebells with Haytor","Bbells_Holwell_p1_thumb.jpg",130,87,5);thumbnails[5450183]=new thumbnail(5450183,"307470","Bluebells Houndtor","Bbells_Houndtor_wall_thumb.jpg",130,87,5);thumbnails[5450186]=new thumbnail(5450186,"307470","Bluebells May Blossom Dunsford Woods","Bbells_may_blossom_Dunsford_thumb.jpg",130,87,5);thumbnails[5450187]=new thumbnail(5450187,"307470","Bluebells Meldon Woods","bbells_Meldon_thumb.jpg",130,87,5);thumbnails[5450195]=new thumbnail(5450195,"307470","Castle Drogo, Broom","castle_drogo_broom_thumb.jpg",130,87,5);thumbnails[5450208]=new thumbnail(5450208,"307470","Willd daffodils and Catkins Dunsford Woods","daffs_and_Catkins_Dunsford_thumb.jpg",130,87,5);thumbnails[5450217]=new thumbnail(5450217,"307470","Daffodils Teign Valley","Daffs_Teignvalley__thumb.jpg",130,87,5);thumbnails[5450235]=new thumbnail(5450235,"307470","Primroses Hisley Bridge","Hisley_Bridge_primroses23_thumb.JPG",130,87,5);thumbnails[5450238]=new thumbnail(5450238,"307470","Hisley Bridge","Hisley_bridge_sp_pol15_thumb.JPG",130,87,5);thumbnails[5450242]=new thumbnail(5450242,"307470","Piles Copse","Piles_copse_lambs_thumb.jpg",130,87,5);thumbnails[5450244]=new thumbnail(5450244,"307470","Dartmoor Mare framing foal","Ponies_mare_framing_foal_thumb.jpg",130,87,5);thumbnails[5450251]=new thumbnail(5450251,"307470","Primrose Bank Lustleigh Cleave","Primroses_close33_thumb.JPG",130,87,5);thumbnails[5450332]=new thumbnail(5450332,"307470","Buckland bridge","Water_Buckland_br_sp_thumb.jpg",130,87,5);thumbnails[5450343]=new thumbnail(5450343,"307470","Canonteign Dawn","Water_Canonteign_dawn_thumb.jpg",130,87,5);thumbnails[5450353]=new thumbnail(5450353,"307470","Widecombe Valley Dartmoor mare and foal","Widecombe_valley_ponies_mare_foal10_thumb.JPG",130,87,5);thumbnails[5593839]=new thumbnail(5593839,"307470","Wild Daffodils Dunsford Woods","daffs_Dunsford_distant_pt_thumb.jpg",130,195,5);thumbnails[5594086]=new thumbnail(5594086,"307470","Dartmoor White Faced Lamb","CNV00003_thumb.JPG",130,88,5);thumbnails[5594088]=new thumbnail(5594088,"307470","Dartmoor White Faced Lambs","CNV00018_thumb.JPG",130,88,5);thumbnails[5435677]=new thumbnail(5435677,"307470","Bluebells Greator","Bbell_Greator_thumb.jpg",130,87,5);thumbnails[5450160]=new thumbnail(5450160,"307470","Bluebells May Blossom Houndtor Horizon from Medieval village<br>\r\n","BBells__may_blossom_pt6_thumb.JPG",130,195,5);thumbnails[5450198]=new thumbnail(5450198,"307470","Clam Bridge with Primrose","clam_bridge_primrose_thumb.jpg",130,195,5);thumbnails[5450224]=new thumbnail(5450224,"307470","Dart Gorge Dartmoor Mare and Foal<br>\r\n","Dart_gorge_ponies_to_Combestone24_thumb.JPG",130,195,5);thumbnails[5450330]=new thumbnail(5450330,"307470","Becky Falls","Water_Becky_falls_near_to_far_thumb.jpg",130,195,5);thumbnails[5450337]=new thumbnail(5450337,"307470","Canon Teign Wild Garlic","Water_Canon_teign_wild_garlic_thumb.jpg",130,195,5);thumbnails[5450346]=new thumbnail(5450346,"307470","Widecombe lambs","widecombe_lambs_thumb.jpg",130,195,5);thumbnails[5438629]=new thumbnail(5438629,"307471","Bowerman Summer Sunset","Bowerman_sset_thumb.jpg",130,87,5);thumbnails[5438630]=new thumbnail(5438630,"307471","Combestone Tor Hawthorn evening light.","combestone_hawthorn_thumb.jpg",130,87,5);thumbnails[5438632]=new thumbnail(5438632,"307471","Great Mis Tor moon rise","Great_Mis_tor_moon_rise_thumb.jpg",130,87,5);thumbnails[5438633]=new thumbnail(5438633,"307471","Great Staple Tor sunset","Great_Staple_tor_sset_thumb.jpg",130,87,5);thumbnails[5451713]=new thumbnail(5451713,"307471","Cranmere Pool","Cranmere_pool_thumb.jpg",130,87,5);thumbnails[5451733]=new thumbnail(5451733,"307471","Haytor from Saddle Tor","haytor_from_saddle_t_heather_thumb.jpg",130,87,5);thumbnails[5451878]=new thumbnail(5451878,"307471","Bell Tor Heather ","Bell_tor_heather_thumb.jpg",130,87,5);thumbnails[5451879]=new thumbnail(5451879,"307471","Belted Galloways sunrise","Cow_Belted_galloways_sunrise_group33e_thumb.JPG",130,87,5);thumbnails[5451897]=new thumbnail(5451897,"307471","Belted Galloway cow and calf","Cow_calf_Belted_galloways_37_thumb.JPG",130,87,5);thumbnails[5451902]=new thumbnail(5451902,"307471","Old English Longhorn","cow_Shorthorn_mtn_ash_arty_thumb.JPG",130,87,5);thumbnails[5451905]=new thumbnail(5451905,"307471","Old English Longhorn","Cow_Shorthorn_mtn_ash_thumb.JPG",130,87,5);thumbnails[5451926]=new thumbnail(5451926,"307471","East Dart","East_dart_below_falls_thumb.jpg",130,87,5);thumbnails[5451941]=new thumbnail(5451941,"307471","Giant's chair with gorse","giants_chair_gorse18_thumb.JPG",130,87,5);thumbnails[5451958]=new thumbnail(5451958,"307471","Grey Wethers' Double Stone Circle","grey_wethers_sset_thumb.jpg",130,87,5);thumbnails[5451965]=new thumbnail(5451965,"307471","Haytor Heather and Gorse","Haytor_foot_heather_and_gorse_thumb.jpg",130,87,5);thumbnails[5451969]=new thumbnail(5451969,"307471","Houndtor from Honeybag Tor","Houndtor_from_honeybag_moonrise_sset_thumb.jpg",130,87,5);thumbnails[5451975]=new thumbnail(5451975,"307471","Houndtor Kistvaen","Houndtor_gorse_kist_thumb.jpg",130,87,5);thumbnails[5451977]=new thumbnail(5451977,"307471","Houndtor with Mountain Ash","houndtor_mtn_ash_thumb.jpg",130,87,5);thumbnails[5451979]=new thumbnail(5451979,"307471","Houndtor framed by Mountain Ash and Stone Wall","houndtor_wall_mtn_ash_thumb.jpg",130,87,5);thumbnails[5451987]=new thumbnail(5451987,"307471","Jay's Grave with foxgloves","Jays_Grave_foxgloves_1_thumb.JPG",130,87,5);thumbnails[5451988]=new thumbnail(5451988,"307471","Electrical Storm ","Lightening_Haldon_thumb.jpg",130,87,5);thumbnails[5451993]=new thumbnail(5451993,"307471","Postbridge with Clapper Bridge","postbridge_framed_clapper_thumb.jpg",130,87,5);thumbnails[5451998]=new thumbnail(5451998,"307471","Postbridge evening rays of light","postbridge_framed_rays_thumb.jpg",130,87,5);thumbnails[5452019]=new thumbnail(5452019,"307471","Scorhill Stone Circle","Scorhill__ponies_thumb.jpg",130,87,5);thumbnails[5452021]=new thumbnail(5452021,"307471","Swincombe Stepping Stones","Swincombe_stepping_stones_thumb.jpg",130,87,5);thumbnails[5454432]=new thumbnail(5454432,"307471","Wistman's Wood","wistmans_wood_print_thumb.jpg",130,87,5);thumbnails[5593908]=new thumbnail(5593908,"307471","10 Commandment Stones","CNV00007_thumb.JPG",130,87,5);thumbnails[5451991]=new thumbnail(5451991,"307471","Moretonhampstead Buttercups","Moreton_buttercups1_thumb.jpg",130,195,5);thumbnails[5454440]=new thumbnail(5454440,"307471","Wallabrook Clapper","Wallabrook_clapper_gorse123_thumb.jpg",130,195,5);thumbnails[5454482]=new thumbnail(5454482,"307471","Watern Tor","watern_tor_ls_thumb.jpg",130,87,5);thumbnails[5454616]=new thumbnail(5454616,"307471","Watern Tor","Watern_tor_pt_thumb.jpg",130,195,5);thumbnails[5454625]=new thumbnail(5454625,"307471","Lustleigh Cleave","water_lustleigh_cleave_sm_contrast_thumb.jpg",130,195,5);thumbnails[5454631]=new thumbnail(5454631,"307471","Widecombe heather and gorse","widecombe_heather_gorse_thumb.jpg",130,195,5);thumbnails[5438649]=new thumbnail(5438649,"307473","Burrator Reservoir from Yennadon Down<br>\r\n","Burrator_reservoir_thumb.jpg",130,87,5);thumbnails[5438655]=new thumbnail(5438655,"307473","Brentor Church Sunset","Brentor_thumb.jpg",130,87,5);thumbnails[5438657]=new thumbnail(5438657,"307473","River Erme Autumn","Erme_at_thumb.jpg",130,87,5);thumbnails[5438660]=new thumbnail(5438660,"307473","Pew Tor Evening light after the storm.","Pew_tor_at_thumb.jpg",130,87,5);thumbnails[5438664]=new thumbnail(5438664,"307473","River Webburn, Buckland Bridge","Webburn_Buckland_bridge_thumb.jpg",130,87,5);thumbnails[5452098]=new thumbnail(5452098,"307473","Bellever Tor","Bellever_tor_thumb.jpg",130,87,5);thumbnails[5452099]=new thumbnail(5452099,"307473","Branscombe's Loaf","Branscombes_loaf_thumb.jpg",130,87,5);thumbnails[5452110]=new thumbnail(5452110,"307473","Grenofen Bridge","Grenofen_Bridge_water_thumb.jpg",130,87,5);thumbnails[5452111]=new thumbnail(5452111,"307473","Haytor Harvest Moon","haytor_harvest_moon_thumb.jpg",130,87,5);thumbnails[5452113]=new thumbnail(5452113,"307473","Houndtor Dusk","Houndtor_dusk_thumb.jpg",130,87,5);thumbnails[5452116]=new thumbnail(5452116,"307473","Old Grey Mare ","Ponies_old_gray_mare_blackhill_sset_thumb.jpg",130,87,5);thumbnails[5452154]=new thumbnail(5452154,"307473","Spitchwick to Leigh Tor","Spichwick_to_Leigh_tor_thumb.jpg",130,87,5);thumbnails[5452157]=new thumbnail(5452157,"307473","Spitchwick ","Spitchwick_leaves_water_thumb.jpg",130,87,5);thumbnails[5452163]=new thumbnail(5452163,"307473","Knarled Ancient Oak","wistwood_pt1_thumb.jpg",130,195,5);thumbnails[5452173]=new thumbnail(5452173,"307473","Lustleigh Cleave","Lusteigh_cleave_contrast_water_thumb.jpg",130,195,5);thumbnails[5452174]=new thumbnail(5452174,"307473","River Walkham","River_Walkham_water_pt1_thumb.jpg",130,195,5);thumbnails[5438662]=new thumbnail(5438662,"307473","Teign Tolmen","t_tolman1_thumb.jpg",130,195,5);thumbnails[5438752]=new thumbnail(5438752,"307474","Dusk Pines Halshanger","Dusk_pines_thumb.jpg",130,87,5);thumbnails[5438756]=new thumbnail(5438756,"307474","Amil with Greator and Houndtor","frosty_tree_greator_thumb.jpg",130,87,5);thumbnails[5438767]=new thumbnail(5438767,"307474","Hexworthy snowdrops evening light","Hexworthy_snowdrops_thumb.jpg",130,87,5);thumbnails[5438774]=new thumbnail(5438774,"307474","Houndtor to Haytor winter sunrise","Houndtor__vivid_wint_srise_thumb.jpg",130,87,5);thumbnails[5438779]=new thumbnail(5438779,"307474","Houndtor to Haytor sheep","Houndtor_to_Haytor_thumb.jpg",130,87,5);thumbnails[5438786]=new thumbnail(5438786,"307474","Manaton Rocks to Haytor evening sundown","Manaton_rocks_wt_thumb.jpg",130,87,5);thumbnails[5450257]=new thumbnail(5450257,"307474","Snowdops Huccaby","Snowdrops_Huccaby_close_thumb.jpg",130,87,5);thumbnails[5450321]=new thumbnail(5450321,"307474","snowdrops Whiddon Woods","Snowdrops_Whiddon_woods_thumb.jpg",130,87,5);thumbnails[5461749]=new thumbnail(5461749,"307474","Beardown Man","Beardown_Man_thumb.jpg",130,86,5);thumbnails[5461752]=new thumbnail(5461752,"307474","Cherry Brook West Dart Confluence Dawn","Cherry_brook_West_Dart_dawn_ls_thumb.jpg",130,87,5);thumbnails[5461754]=new thumbnail(5461754,"307474","Clam Bridge","Clam_bridge_wt_thumb.jpg",130,87,5);thumbnails[5461756]=new thumbnail(5461756,"307474","Fur Tor","Furtor_single_thumb.jpg",130,87,5);thumbnails[5461758]=new thumbnail(5461758,"307474","Haytor Quarry","Haytor_quarry_wt_thumb.jpg",130,87,5);thumbnails[5461759]=new thumbnail(5461759,"307474","Jay's Grave","Jays_Grave_thumb.jpg",130,87,5);thumbnails[5461761]=new thumbnail(5461761,"307474","Lowman Haytor","Lowman_thumb.jpg",130,87,5);thumbnails[5461762]=new thumbnail(5461762,"307474","Tavy Cleave","Tavy_cleave_jan_thumb.jpg",130,87,5);thumbnails[5649501]=new thumbnail(5649501,"307474","Giant's chair","Giants_chair_151_thumb.JPG",130,87,5);thumbnails[5649525]=new thumbnail(5649525,"307474","Cator Bridge","Cator_Bridge_thumb.JPG",130,87,5);thumbnails[5450282]=new thumbnail(5450282,"307474","Snowdrops Whiddon Woods","snowdrops_whiddon_p_thumb.jpg",130,195,5);thumbnails[5438745]=new thumbnail(5438745,"307474","Dawn Cherrybrook West Dart confluence<br>\r\n","Cherrybrook_west_Dart_dawn_port_thumb.jpg",130,195,5);thumbnails[5438790]=new thumbnail(5438790,"307474","Widecombe-in-the Moor Cathedral","widport_thumb.jpg",87,130,5);thumbnails[5438728]=new thumbnail(5438728,"308164","Chagford panorama","Chagford_Panorama_from_Meldon_Hillcp_thumb.jpg",130,22,5);thumbnails[5438764]=new thumbnail(5438764,"308164","Fur Tor Panorama","Furtor_pan_3_cp_thumb.jpg",130,39,5);thumbnails[5451611]=new thumbnail(5451611,"308164","Beardown Man","Beardown_man_pancp_bigger_thumb.jpg",130,42,5);var galleries=new Object();galleries[317206]=new gallery(317206,"","New Images","gallery",[]);galleries[307470]=new gallery(307470,"5594088,5594086,5593839,5450353,5450332,5450244,5450242,5450238,5450235,5450217,5450208,5450195,5450187,5450186,5450183,5450175,5450163,5438583","Dartmoor Spring","gallery",[5438583,5438595,5450163,5450175,5450183,5450186,5450187,5450195,5450208,5450217,5450235,5450238,5450242,5450244,5450251,5450332,5450343,5450353,5593839,5594086,5594088,5435677,5450160,5450198,5450224,5450330,5450337,5450346]);galleries[307471]=new gallery(307471,"5593908,5454432,5452021,5452019,5451998,5451993,5451988,5451987,5451979,5451977,5451975,5451969,5451965,5451958,5451941,5451926,5451905,5451902,5451878,5451733,5451713,5438633,5438632,5438630,5438629","Dartmoor Summer","gallery",[5438629,5438630,5438632,5438633,5451713,5451733,5451878,5451879,5451897,5451902,5451905,5451926,5451941,5451958,5451965,5451969,5451975,5451977,5451979,5451987,5451988,5451993,5451998,5452019,5452021,5454432,5593908,5451991,5454440,5454482,5454616,5454625,5454631]);galleries[307473]=new gallery(307473,"5452157,5452154,5452113,5452111,5452099,5452098,5438649","Dartmoor Autumn","gallery",[5438649,5438655,5438657,5438660,5438664,5452098,5452099,5452110,5452111,5452113,5452116,5452154,5452157,5452163,5452173,5452174,5438662]);galleries[307474]=new gallery(307474,"5649525,5649501,5461762,5461761,5461759,5461758,5461756,5461754,5461752,5461749,5450321","Dartmoor Winter","gallery",[5438752,5438756,5438767,5438774,5438779,5438786,5450257,5450321,5461749,5461752,5461754,5461756,5461758,5461759,5461761,5461762,5649501,5649525,5450282,5438745,5438790]);galleries[308164]=new gallery(308164,"5438764,5438728","Dartmoor Panoramas","gallery",[5438728,5438764,5451611]);var imageSets=new Object();imageSets[1]="5649525,5649501,5594088,5594086,5593908,5461762,5461761,5461759,5461758,5461756,5461754,5461752,5461749,5454432,5452157,5452154,5452113,5452111,5452099,5452098,5452021,5452019,5451998,5451993,5451988,5451987,5451979,5451977,5451975,5451969,5451965,5451958,5451941,5451926,5451905,5451902,5451878,5451733,5451713,5450353,5450332,5450321,5450244,5450242,5450238,5450235,5450217,5450208,5450195,5450187,5450186,5450183,5450175,5450163,5438649,5438633,5438632,5438630,5438629,5438583,5435677";imageSets[2]="5649525,5649501,5594088,5594086,5593908,5593839,5461762,5461761,5461759,5461758,5461756,5461754,5461752,5461749,5454432,5452157,5452154,5452113,5452111,5452099,5452098,5452021,5452019,5451998,5451993,5451988,5451987,5451979,5451977,5451975,5451969,5451965,5451958,5451941,5451926,5451905,5451902,5451878,5451733,5451713,5450353,5450332,5450321,5450244,5450242,5450238,5450235,5450217,5450208,5450195,5450187,5450186,5450183,5450175,5450163,5438764,5438728,5438649,5438633,5438632,5438630,5438629,5438583";imageSets[3]="5649525,5649501,5594088,5594086,5593908,5461762,5461761,5461759,5461758,5461756,5461754,5461752,5461749,5454432,5452157,5452154,5452113,5452111,5452099,5452098,5452021,5452019,5451998,5451993,5451988,5451987,5451979,5451977,5451975,5451969,5451965,5451958,5451941,5451926,5451905,5451902,5451878,5451733,5451713,5450353,5450332,5450321,5450244,5450242,5450238,5450235,5450217,5450208,5450195,5450187,5450186,5450183,5450175,5450163,5438649,5438633,5438632,5438630,5438583,5435677";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/robchutchinson/images";break}switch(a){case 1:b="http://www1.clikpic.com/robchutchinson/images";break}switch(a){case 2:b="http://admin.clikpic.com/robchutchinson/images";break}switch(a){case 24:b="http://tpc15/clikpic/robchutchinson/images";break}switch(a){case 4:b="http://www.clikchurch.com/robchutchinson/images";break}switch(a){case 5:b="http://www2.clikpic.com/robchutchinson/images";break}switch(a){case 22:b="http://tpc5/clikpic/robchutchinson/images";break}switch(a){case 23:b="http://tpc10/clikpic/robchutchinson/images";break}switch(a){case 25:b="http://tpc16/clikpic/robchutchinson/images";break}switch(a){case 15:b="http://www3.clikpic.com/robchutchinson/images";break}switch(a){case 18:b="http://www4.clikpic.com/robchutchinson/images";break}switch(a){case 19:b="http://www5.clikpic.com/robchutchinson/images";break}switch(a){case 31:b="http://www7.clikpic.com/robchutchinson/images";break}switch(a){case 32:b="http://admin2.clikpic.com/robchutchinson/images";break}switch(a){case 33:b="http://www8.clikpic.com/robchutchinson/images";break}switch(a){case 34:b="http://www9.clikpic.com/robchutchinson/images";break}switch(a){case 35:b="http://admin3.clikpic.com/robchutchinson/images";break}switch(a){case 37:b="http://admin4.clikpic.com/robchutchinson/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="Dartmoor Photos Rob Hutchinson Oyster Photographic: "+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;resizePhotoInfo();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>"}a=a+fnGetPaymentInfo(photos[b]);if(a!=""){a=a+'<div class="spacer"></div>'}return a}function fnGetPaymentInfo(c){var b="";if(c.item_price!==""){b=b+"<p>Buy now using PayPal:</p>";b=b+'<p class="imageinfo" id="imagePrice"><strong>'+c.purchase_instruction+"</strong> 				&pound;"+(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+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="item_name" value="'+e+'">';ref="";if(c.photo_ref!=""){ref=c.photo_ref+" - "+c.caption}else{ref=c.id+" - "+c.caption}price=d;b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="oysterphoto@onetel.com">';b=b+'<input type="hidden" name="currency_code" value="GBP">';b=b+'<input type="hidden" name="add" value="1">';b=b+'<input type="hidden" name="amount" value="'+d+'">';b=b+'<input type="hidden" name="item_number" value="'+ref+'">';b=b+'<input type="Submit" value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";b=b+'<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="oysterphoto@onetel.com">';b=b+'<input type="hidden" name="display" value="1">';b=b+'<input type="Submit" value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";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+'")'})}}};