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[1729860]=new thumbnail(1729860,"112989","1st Sunset of 2008","1st 2008 Sunset4_thumb.jpg",130,87,18);thumbnails[1673997]=new thumbnail(1673997,"112991","Seatown 1","Seatown_201007_Fin_480_40D_thumb.jpg",130,87,18);thumbnails[1674062]=new thumbnail(1674062,"112989","Pulpit Rock, dorset","IMG_2887a1_thumb.jpg",130,198,18);thumbnails[1674376]=new thumbnail(1674376,"112992","Worbarrow Bay 1","Warbarrow_290807_Temp_037_20D_8_20D_9_20D_tonemapped copy_thumb.jpg",130,86,18);thumbnails[1674727]=new thumbnail(1674727,"112981","Kimmeridge 1","Kimmeridge 01_thumb.jpg",130,86,18);thumbnails[1674861]=new thumbnail(1674861,"112991","Seatown 2","Seatown 2_thumb.jpg",130,87,18);thumbnails[1675327]=new thumbnail(1675327,"112991","Seatown 3","Seatown 3_thumb.jpg",130,84,18);thumbnails[1675328]=new thumbnail(1675328,"112991","Seatown 4","Seatown 4_thumb.jpg",130,87,18);thumbnails[1675356]=new thumbnail(1675356,"112981","Kimmeridge 2","Kimeridge 2_thumb.jpg",130,87,18);thumbnails[1675360]=new thumbnail(1675360,"112981","Kimmeridge 3","Kimmeridge 3_thumb.jpg",130,87,18);thumbnails[1675662]=new thumbnail(1675662,"112981","Kimmeridge 4","Kimmeridge 4_thumb.jpg",130,87,18);thumbnails[1675666]=new thumbnail(1675666,"112981","Kimmeridge 5","Kimmeridge 5_thumb.jpg",130,87,18);thumbnails[1675668]=new thumbnail(1675668,"112981","Kimmeridge 6","Kimmeridge 6_thumb.jpg",130,195,18);thumbnails[1678729]=new thumbnail(1678729,"112992","Worbarrow Bay 2","Warbarrow 23_thumb.jpg",130,87,18);thumbnails[1678730]=new thumbnail(1678730,"112989","Seat with a view","Seat with a View1_thumb.jpg",130,87,18);thumbnails[1718951]=new thumbnail(1718951,"112992","Worbarrow Bay 3","Warbarrow 3_thumb.jpg",130,195,18);thumbnails[1725174]=new thumbnail(1725174,"112991","Seatown 5","Seatown 5_thumb.jpg",130,87,18);thumbnails[1725176]=new thumbnail(1725176,"112991","Seatown 6","Seatown 6_thumb.jpg",130,87,18);thumbnails[1725181]=new thumbnail(1725181,"112991","Seatown 7","Seatown 7_thumb.jpg",130,195,18);thumbnails[1727604]=new thumbnail(1727604,"112991","Seatown 8","Seatown 8_thumb.jpg",130,87,18);thumbnails[1867196]=new thumbnail(1867196,"125601","Durdle Door 1","Durdle Door 1_thumb.jpg",130,87,18);thumbnails[1867954]=new thumbnail(1867954,"125601","Durdle Door 2","Durdle Door 2_thumb.jpg",130,87,18);thumbnails[1867970]=new thumbnail(1867970,"125601","Durdle Door 3","Durdle Door 3_thumb.jpg",130,87,18);thumbnails[1867980]=new thumbnail(1867980,"125601","Durdle Door 4","Durdle Door 4_thumb.jpg",130,87,18);thumbnails[1867994]=new thumbnail(1867994,"125601","Durdle Door 5","Durdle Door 5_thumb.jpg",130,87,18);thumbnails[1868033]=new thumbnail(1868033,"125601","Durdle Door 6","Durdle Door 6_thumb.jpg",130,87,18);thumbnails[1868042]=new thumbnail(1868042,"125601","Durdle Door 7","Durdle Door 7_thumb.jpg",130,87,18);thumbnails[1868056]=new thumbnail(1868056,"125601","Durdle Door 8","Durdle Door 8_thumb.jpg",130,87,18);thumbnails[1868071]=new thumbnail(1868071,"125601","Durdle Door 9","Durdle Door 9_thumb.jpg",130,87,18);thumbnails[1883872]=new thumbnail(1883872,"126533","Dancing Ledge 1","Dancing Ledge 1_thumb.jpg",130,87,18);thumbnails[1883876]=new thumbnail(1883876,"126533","Dancing Ledge 2","Dancing Ledge 2_thumb.jpg",130,87,18);thumbnails[1883882]=new thumbnail(1883882,"126533","Dancing Ledge 3","Dancing Ledge 3_thumb.jpg",130,87,18);thumbnails[1883891]=new thumbnail(1883891,"126533","Dancing Ledge 4","Dancing Ledge 4_thumb.jpg",130,87,18);thumbnails[2308900]=new thumbnail(2308900,"112981","Kimmeridge 8","Kimmeridge 81_thumb.jpg",130,87,18);thumbnails[2308949]=new thumbnail(2308949,"151012","Mupe Bay 1","Mupe Bay 1_thumb.jpg",130,87,18);thumbnails[2308955]=new thumbnail(2308955,"151010","Osmington 1","Osmington 11_thumb.jpg",130,87,18);thumbnails[2308960]=new thumbnail(2308960,"151010","Osmington 2","Osmington 2_thumb.jpg",130,87,18);thumbnails[2308963]=new thumbnail(2308963,"151010","Osmington 3","Osmington 3_thumb.jpg",130,87,18);thumbnails[2308967]=new thumbnail(2308967,"151010","Osmington 4","Osmington 4_thumb.jpg",130,87,18);thumbnails[2308968]=new thumbnail(2308968,"151010","Osmington 5","Osmington 5_thumb.jpg",130,87,18);thumbnails[2308969]=new thumbnail(2308969,"151010","Osmington 6","Osmington 6_thumb.jpg",130,87,18);thumbnails[2308971]=new thumbnail(2308971,"151012","Mupe Rocks 1","Mupe Rocks 1_thumb.jpg",130,195,18);thumbnails[2308979]=new thumbnail(2308979,"151013","Chapman's Pool 1","Chapman's Pool 1_thumb.jpg",130,87,18);thumbnails[2308982]=new thumbnail(2308982,"151013","Chapman's Pool 2","Chapman's Pool 2_thumb.jpg",130,87,18);thumbnails[2308984]=new thumbnail(2308984,"151013","Chapman's Pool 3","Chapman's Pool 3_thumb.jpg",130,87,18);thumbnails[2308991]=new thumbnail(2308991,"151014","Stair Hole 1","Stair Hole 1_thumb.jpg",130,195,18);thumbnails[2308992]=new thumbnail(2308992,"151014","Stair Hole 2","Stair Hole 2_thumb.jpg",130,87,18);thumbnails[2308994]=new thumbnail(2308994,"151014","Stair Hole 3","Stair Hole 3_thumb.jpg",130,195,18);thumbnails[2308996]=new thumbnail(2308996,"151014","Stair Hole 4","Stair Hole 4_thumb.jpg",130,87,18);thumbnails[2309004]=new thumbnail(2309004,"112981","Kimmeridge 7","Kimmeridge 72_thumb.jpg",130,87,18);thumbnails[2309008]=new thumbnail(2309008,"112981","Kimmeridge 9","Kimmeridge 9_thumb.jpg",130,87,18);thumbnails[2309009]=new thumbnail(2309009,"112981","Kimmeridge 10","Kimmeridge 10_thumb.jpg",130,195,18);thumbnails[2309305]=new thumbnail(2309305,"151010","Osmington 7","Osmington 7_thumb.jpg",130,195,18);thumbnails[2309308]=new thumbnail(2309308,"151010","Osmington 8","Osmington 8_thumb.jpg",130,87,18);thumbnails[2309311]=new thumbnail(2309311,"151010","Osmington 9","Osmington 9_thumb.jpg",130,195,18);thumbnails[2309314]=new thumbnail(2309314,"151010","Osmington 10","Osmington 10_thumb.jpg",130,195,18);thumbnails[2309357]=new thumbnail(2309357,"112989","Portland Bill Lighthouse 1","Portland Bill Lighthouse 1_thumb.jpg",130,195,18);thumbnails[2309361]=new thumbnail(2309361,"112989","Portland Bill Lighthouse 2","Portland Bill Lighthouse 2_thumb.jpg",130,195,18);thumbnails[2312806]=new thumbnail(2312806,"151012","Mupe Rocks 2","Mupe Rocks 2_thumb.jpg",130,195,18);thumbnails[2312955]=new thumbnail(2312955,"151210","Snowdonia 1","Snowdonia 1_thumb.jpg",130,87,18);thumbnails[2312959]=new thumbnail(2312959,"151210","Snowdonia 2","Snowdonia 2_thumb.jpg",130,195,18);thumbnails[2312964]=new thumbnail(2312964,"151210","Snowdonia 3","Snowdonia 3_thumb.jpg",130,195,18);thumbnails[2312975]=new thumbnail(2312975,"151210","Snowdonia 4","Snowdonia 4_thumb.jpg",130,87,18);thumbnails[2887738]=new thumbnail(2887738,"179213","Fleet 1","IMG_7864_thumb.jpg",130,86,18);thumbnails[2888300]=new thumbnail(2888300,"179213","Fleet 2","IMG_7844 (2)_thumb.jpg",129,195,18);thumbnails[2888325]=new thumbnail(2888325,"179213","Fleet 3","IMG_7779 (1)_thumb.jpg",130,84,18);thumbnails[2888424]=new thumbnail(2888424,"112989","Portland Bill Lighthouse 3","DPP_0016 (1)_thumb.jpg",130,56,18);thumbnails[2888483]=new thumbnail(2888483,"112989","Portland Bill Lighthouse 4","DPP_0017 worked (1)_thumb.jpg",129,136,18);thumbnails[2888502]=new thumbnail(2888502,"112989","Pulpit Rock","IMG_7929 (1)_thumb.jpg",129,195,18);thumbnails[2888540]=new thumbnail(2888540,"179264","Corfe Castle 1","IMG_8245 (1)_thumb.jpg",130,86,18);thumbnails[2888562]=new thumbnail(2888562,"179264","Corfe Castle 2","DPP_0032_thumb.jpg",130,52,18);thumbnails[5529811]=new thumbnail(5529811,"","","IMG_86561_thumb.jpg",130,87,18);thumbnails[5529943]=new thumbnail(5529943,"151010","Osmington 11 ","Ozmin111_thumb.jpg",130,86,18);thumbnails[5530286]=new thumbnail(5530286,"313296","Yorkshire","DPP_Yorky_Disc_104550_1112_thumb.jpg",130,87,18);thumbnails[5530376]=new thumbnail(5530376,"313296","Close Fall","Close_Fall1_1_thumb.jpg",130,84,18);thumbnails[5530407]=new thumbnail(5530407,"313296","Yorky Silho","DPP_Yorky_Disc_204597_1_thumb.jpg",130,53,18);thumbnails[5530415]=new thumbnail(5530415,"313296","Another Tree","DPP_Yorky_Disc_204573_1_thumb.jpg",130,87,18);thumbnails[5534173]=new thumbnail(5534173,"313587","","DPP_Yorky_Disc_204712_1_thumb.jpg",67,100,18);thumbnails[1718988]=new thumbnail(1718988,"151210","Snowdonia 5","Crib Goch_thumb.jpg",130,195,18);thumbnails[1674854]=new thumbnail(1674854,"112993","Flower 1","Flower 1_thumb.jpg",130,87,18);thumbnails[1676062]=new thumbnail(1676062,"112993","Flower 2","Flower 2_thumb.jpg",130,81,18);thumbnails[1676133]=new thumbnail(1676133,"112993","Flower 3","Flower 3_thumb.jpg",130,86,18);thumbnails[1676137]=new thumbnail(1676137,"112993","Flower 4","Flower 4_thumb.jpg",130,195,18);thumbnails[1676140]=new thumbnail(1676140,"112993","Flower 5","Flower 5_thumb.jpg",130,101,18);thumbnails[1676143]=new thumbnail(1676143,"112993","Flower 6","Flower 6_thumb.jpg",130,87,18);thumbnails[1676147]=new thumbnail(1676147,"112993","Flower 7","Flower 7_thumb.jpg",130,87,18);thumbnails[1676217]=new thumbnail(1676217,"112993","Flower 8","Flower 8_thumb.jpg",130,87,18);thumbnails[1676220]=new thumbnail(1676220,"112993","Flower 9","Flower 9_thumb.jpg",130,87,18);thumbnails[1678280]=new thumbnail(1678280,"112993","Flower 10","Flower 10_thumb.jpg",130,217,18);thumbnails[1678802]=new thumbnail(1678802,"112993","Flower 11","Flower 11_thumb.jpg",130,87,18);thumbnails[2888675]=new thumbnail(2888675,"112993","Flower 12","IMG_7965_thumb.jpg",130,86,18);thumbnails[1674098]=new thumbnail(1674098,"112908","Dronefly close-up","Bee 8_filtered1_thumb.jpg",130,122,18);thumbnails[1678150]=new thumbnail(1678150,"112908","Window Spider","Window Spider_thumb.jpg",130,89,18);thumbnails[1678160]=new thumbnail(1678160,"112908","Window Spider close-up","Window Spider Close-up_thumb.jpg",130,109,18);thumbnails[1678168]=new thumbnail(1678168,"112908","Crane Fly Close-up","Crane Fly Close-up_thumb.jpg",130,87,18);thumbnails[1678172]=new thumbnail(1678172,"112908","House Fly 1","House Fly 1_thumb.jpg",130,87,18);thumbnails[1678181]=new thumbnail(1678181,"112908","House Fly 2","House Fly 2_thumb.jpg",130,79,18);thumbnails[1678187]=new thumbnail(1678187,"112908","House Fly 3","House Fly 3_thumb.jpg",130,161,18);thumbnails[1678192]=new thumbnail(1678192,"112908","Ant 1","Ant 1_thumb.jpg",130,59,18);thumbnails[1678196]=new thumbnail(1678196,"112908","Ant 2","Ant 2_thumb.jpg",130,65,18);thumbnails[1678199]=new thumbnail(1678199,"112908","Ant 3","Ant 3_thumb.jpg",130,91,18);thumbnails[1678213]=new thumbnail(1678213,"112908","Ant 4","Ant 4_thumb.jpg",130,82,18);thumbnails[1678250]=new thumbnail(1678250,"112908","Ant 5","Ant 5_thumb.jpg",130,87,18);thumbnails[1678253]=new thumbnail(1678253,"112908","Bumble Bee","Bumble Bee_thumb.jpg",130,87,18);thumbnails[1678255]=new thumbnail(1678255,"112908","Bumble Bee Close-up","Bumble Bee - Eye Contact!_thumb.jpg",130,87,18);thumbnails[1678262]=new thumbnail(1678262,"112908","Catterpillar","Catterpillar_thumb.jpg",130,90,18);thumbnails[1678268]=new thumbnail(1678268,"112908","Drone Fly","Drone Fly_thumb.jpg",130,75,18);thumbnails[1678274]=new thumbnail(1678274,"112908","Drone Fly - Eye Detail","Drone Fly Eye Detail - Close-up_thumb.jpg",130,211,18);thumbnails[1680757]=new thumbnail(1680757,"113293","Wheat Field","Wheat Field_thumb.jpg",130,195,18);thumbnails[1685213]=new thumbnail(1685213,"112908","Moth","Moth_thumb.jpg",130,87,18);thumbnails[1685224]=new thumbnail(1685224,"113293","Maize Field","Maize_thumb.jpg",130,87,18);thumbnails[1685776]=new thumbnail(1685776,"113293","Dorset Dawn","Dorset Dawn Gausian Blur_thumb.jpg",130,87,18);thumbnails[1718931]=new thumbnail(1718931,"113293","Mon-O-War Cove","Man-O-War Cove_thumb.jpg",130,195,18);thumbnails[1718973]=new thumbnail(1718973,"113293","Glaslyn in Snowdonia","Glaslyn_thumb.jpg",130,87,18);thumbnails[1729866]=new thumbnail(1729866,"113293","Wheat Field 2","Wheat Field 21_thumb.jpg",130,87,18);thumbnails[2308972]=new thumbnail(2308972,"113293","Rapeseed Field","Rapeseed Field_thumb.jpg",130,87,18);thumbnails[2888605]=new thumbnail(2888605,"113293","Forgotten","IMG_8011_thumb.jpg",130,85,18);thumbnails[2888638]=new thumbnail(2888638,"113293","Shipwreck","IMG_8160_thumb.jpg",130,86,18);thumbnails[2888648]=new thumbnail(2888648,"113293","Logs at Puddletown Woods","IMG_7944_thumb.jpg",129,195,18);var galleries=new Object();galleries[151013]=new gallery(151013,"2308984,2308982,2308979","Chapman's Pool","gallery",[2308979,2308982,2308984]);galleries[179264]=new gallery(179264,"2888562,2888540","Corfe Castle","gallery",[2888540,2888562]);galleries[126533]=new gallery(126533,"1883891,1883882,1883876,1883872","Dancing Ledge","gallery",[1883872,1883876,1883882,1883891]);galleries[125601]=new gallery(125601,"1868071,1868056,1868042,1868033,1867994,1867980,1867970,1867954,1867196","Durdle Door","gallery",[1867196,1867954,1867970,1867980,1867994,1868033,1868042,1868056,1868071]);galleries[179213]=new gallery(179213,"2888325,2888300,2887738","Fleet","gallery",[2887738,2888300,2888325]);galleries[112981]=new gallery(112981,"2309009,2309008,2309004,2308900,1675668,1675666,1675662,1675360,1675356,1674727","Kimmeridge Bay","gallery",[1674727,1675356,1675360,1675662,1675666,1675668,2308900,2309004,2309008,2309009]);galleries[151012]=new gallery(151012,"2312806,2308971,2308949","Mupe Bay & Rocks","gallery",[2308949,2308971,2312806]);galleries[151010]=new gallery(151010,"5529943,2309314,2309311,2309308,2309305,2308969,2308968,2308967,2308963,2308960","Osmington Bay","gallery",[2308955,2308960,2308963,2308967,2308968,2308969,2309305,2309308,2309311,2309314,5529943]);galleries[112989]=new gallery(112989,"2888502,2888483,2888424,2309361,2309357,1729860,1678730,1674062","Portland","gallery",[1729860,1674062,1678730,2309357,2309361,2888424,2888483,2888502]);galleries[112991]=new gallery(112991,"1727604,1725181,1725176,1725174,1675328,1675327,1674861,1673997","Seatown","gallery",[1673997,1674861,1675327,1675328,1725174,1725176,1725181,1727604]);galleries[151210]=new gallery(151210,"2312975,2312964,2312959,2312955,1718988","Snowdonia","gallery",[2312955,2312959,2312964,2312975,1718988]);galleries[151014]=new gallery(151014,"2308996,2308994,2308992,2308991","Stair Hole","gallery",[2308991,2308992,2308994,2308996]);galleries[112992]=new gallery(112992,"1718951,1678729,1674376","Worbarrow Bay","gallery",[1674376,1678729,1718951]);galleries[313296]=new gallery(313296,"5530415,5530407,5530376,5530286","Yorkshire","gallery",[5530286,5530376,5530407,5530415]);galleries[313587]=new gallery(313587,"5534173","Yorkshire Coast","gallery",[5534173]);galleries[313265]=new gallery(313265,"5534173,5529943,2888502,2888483,2888424,2312806,2309361,2309357,2309314,2309311","Seascapes","gallery",[]);galleries[112979]=new gallery(112979,"5530415,5530407,5530376,5530286,2888562,2888540,2888325,2888300,2887738,2312975","Landscapes","gallery",[]);galleries[112993]=new gallery(112993,"2888675,1678802,1678280,1676220,1676217,1676147,1676143,1676140,1676137,1676133","Flowers","gallery",[1674854,1676062,1676133,1676137,1676140,1676143,1676147,1676217,1676220,1678280,1678802,2888675]);galleries[112908]=new gallery(112908,"1685213,1678274,1678268,1678262,1678255,1678253,1678250,1678213,1678199,1678196","Macro Images of Insects","gallery",[1674098,1678150,1678160,1678168,1678172,1678181,1678187,1678192,1678196,1678199,1678213,1678250,1678253,1678255,1678262,1678268,1678274,1685213]);galleries[113293]=new gallery(113293,"2888648,2888638,2888605,2308972,1729866,1718973,1718931,1685776,1685224,1680757","Misc","gallery",[1680757,1685224,1685776,1718931,1718973,1729866,2308972,2888605,2888638,2888648]);var imageSets=new Object();imageSets[1]="5534173,5530415,5530407,5530376,5530286,5529943,5529811,2888675,2888648,2888638,2888605,2888562,2888540,2888502,2888483,2888424,2888325,2888300,2887738,2312975,2312964,2312959,2312955,2312806,2309361,2309357,2309314,2309311,2309308,2309305,2309009,2309008,2309004,2308996,2308994,2308992,2308991,2308984,2308982,2308979,2308972,2308971,2308969,2308968,2308967,2308963,2308960,2308955,2308949,2308900";imageSets[3]="5534173,5530415,5530407,5530376,5530286,5529943,5529811,2888675,2888648,2888638,2888605,2888562,2888540,2888502,2888483,2888424,2888325,2888300,2887738,2312975,2312964,2312959,2312955,2312806,2309361,2309357,2309314,2309311,2309308,2309305,2309009,2309008,2309004,2308996,2308994,2308992,2308991,2308984,2308982,2308979,2308972,2308971,2308969,2308968,2308967,2308963,2308960,2308955,2308949,2308900";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/johnfanning/images";break}switch(a){case 1:b="http://www1.clikpic.com/johnfanning/images";break}switch(a){case 2:b="http://admin.clikpic.com/johnfanning/images";break}switch(a){case 24:b="http://tpc15/clikpic/johnfanning/images";break}switch(a){case 4:b="http://www.clikchurch.com/johnfanning/images";break}switch(a){case 5:b="http://www2.clikpic.com/johnfanning/images";break}switch(a){case 22:b="http://tpc5/clikpic/johnfanning/images";break}switch(a){case 23:b="http://tpc10/clikpic/johnfanning/images";break}switch(a){case 25:b="http://tpc16/clikpic/johnfanning/images";break}switch(a){case 15:b="http://www3.clikpic.com/johnfanning/images";break}switch(a){case 18:b="http://www4.clikpic.com/johnfanning/images";break}switch(a){case 19:b="http://www5.clikpic.com/johnfanning/images";break}switch(a){case 31:b="http://www7.clikpic.com/johnfanning/images";break}switch(a){case 32:b="http://admin2.clikpic.com/johnfanning/images";break}switch(a){case 33:b="http://www8.clikpic.com/johnfanning/images";break}switch(a){case 34:b="http://www9.clikpic.com/johnfanning/images";break}switch(a){case 35:b="http://admin3.clikpic.com/johnfanning/images";break}switch(a){case 37:b="http://admin4.clikpic.com/johnfanning/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="'+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="John Fanning Photography: "+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>"}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="j.fanning@tesco.net">';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="j.fanning@tesco.net">';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(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}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+'")'})}}};