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[1227256]=new thumbnail(1227256,"87320","Leopard Frog diving","012_ Leop_ frog_div_thumb.jpg",101,130,1);thumbnails[1235865]=new thumbnail(1235865,"87323","Carder Bumblebee","017_carder_bee_bals1_thumb.jpg",130,96,1);thumbnails[1238525]=new thumbnail(1238525,"","","Voyager 1_thumb.jpg",100,130,1);thumbnails[1240795]=new thumbnail(1240795,"87323","Red Admiral","236_red_admiral_thumb.jpg",130,96,1);thumbnails[1240797]=new thumbnail(1240797,"87323","Green Heliconid","272_green_helicon_thumb.jpg",130,89,1);thumbnails[1240801]=new thumbnail(1240801,"87323","Green Lacewingfly takeing off","358_lacewing_m3_thumb.jpg",107,130,1);thumbnails[1243150]=new thumbnail(1243150,"87323","Carder Bumblebee","096_bumble_blubell_thumb.jpg",130,86,1);thumbnails[1243152]=new thumbnail(1243152,"87323","Common Wasp","209_wasp_apple_thumb.jpg",87,130,1);thumbnails[1243169]=new thumbnail(1243169,"87323","Leafhopper","239_rhod_leafhop_thumb.jpg",91,130,1);thumbnails[1243173]=new thumbnail(1243173,"87323","Common Darter","335_common_darter_thumb.jpg",130,93,1);thumbnails[1243176]=new thumbnail(1243176,"87323","Emerald Damselfly","342_emerald_damselfly_thumb.jpg",130,92,1);thumbnails[1249720]=new thumbnail(1249720,"87323","Hawker dragonfly","331_hawk_dragonfly_eglad_thumb.jpg",130,91,1);thumbnails[1252988]=new thumbnail(1252988,"87323","Jumping Spider","111_plexippus_ x3b_thumb.jpg",130,41,1);thumbnails[2993999]=new thumbnail(2993999,"","A selection of Stephen's Books","all_bks600pix_thumb.jpg",130,78,1);thumbnails[4077660]=new thumbnail(4077660,"","","966_orb_web2_thumb.jpg",90,130,1);thumbnails[4077846]=new thumbnail(4077846,"","","968_wasp_spid_thumb.jpg",87,130,1);thumbnails[4079644]=new thumbnail(4079644,"","","969_green_spid_thumb.jpg",89,130,1);thumbnails[4079742]=new thumbnail(4079742,"","SPIDERS The Ultimate Predators","965_spid_books_2_thumb.jpg",130,82,1);thumbnails[4079816]=new thumbnail(4079816,"","","970_ladybird_spid_thumb.jpg",130,88,1);thumbnails[4080481]=new thumbnail(4080481,"","","spider_book_page112345_thumb.jpg",130,42,1);thumbnails[4106457]=new thumbnail(4106457,"","","971_all_books_thumb.jpg",130,82,1);thumbnails[4863764]=new thumbnail(4863764,"87323","MEADOW GRASSHOPPER","972_Grasshop_take-off_M3_thumb.jpg",105,130,1);thumbnails[5029222]=new thumbnail(5029222,"","","sailfin_exhib_thumb.jpg",96,130,1);thumbnails[5029223]=new thumbnail(5029223,"","","sailfin_exhib1_thumb.jpg",96,130,1);thumbnails[1227253]=new thumbnail(1227253,"87322","Bushbaby portrait","002_bushbaby_cu_thumb.jpg",130,88,1);thumbnails[1227265]=new thumbnail(1227265,"87321","Barn Owl","022_barn_owl_fel_thumb.jpg",89,130,1);thumbnails[1230104]=new thumbnail(1230104,"87320","Wallace's Flying Frog","003_wallace_fly_frog_thumb.jpg",113,130,1);thumbnails[1233588]=new thumbnail(1233588,"87321","KESTREL in FLIGHT","248_kestrel_m6_thumb.jpg",130,39,1);thumbnails[1233639]=new thumbnail(1233639,"87322","HOUSE MOUSE","546_ house_ mouse_stab_thumb.jpg",96,130,1);thumbnails[1233635]=new thumbnail(1233635,"87321","SWALLOW LEAVING BARN","524_swallow_shed_thumb.jpg",129,130,1);thumbnails[1235745]=new thumbnail(1235745,"87320","BROWN BASILISK ","045_basilisk_thumb.jpg",130,102,1);thumbnails[1235748]=new thumbnail(1235748,"87322","BROWN RAT LEAPING","135_rat_bin_thumb.jpg",130,85,1);thumbnails[1236476]=new thumbnail(1236476,"87322","Water Shrew","133_water_shrew_thumb.jpg",130,94,1);thumbnails[4055387]=new thumbnail(4055387,"87320","RED-EYED TREE FROG","059_tree_frog_ventral_thumb.jpg",89,130,1);thumbnails[4058803]=new thumbnail(4058803,"87321","EXPECTANT ROBIN","954_robin_spade_thumb.jpg",90,130,1);thumbnails[1233624]=new thumbnail(1233624,"87321","ROBIN","297_robin_clo_line_thumb.jpg",130,94,1);thumbnails[1236464]=new thumbnail(1236464,"87322","Yellow-necked mouse","284_yellow_neck_mou_thumb.jpg",130,86,1);thumbnails[1243157]=new thumbnail(1243157,"87323","Honey Bee ","226_honeybee_crocus_thumb.jpg",95,130,1);thumbnails[4055373]=new thumbnail(4055373,"87320","RED-EYED TREEFROG","084_tree_frog_mouth1_thumb.jpg",91,130,1);thumbnails[1233622]=new thumbnail(1233622,"87321","SPARROW HAWK","285_sparrow_hk_circ_thumb.jpg",108,130,1);thumbnails[1236390]=new thumbnail(1236390,"87322","LEAPING BUSHBABY","001_bushbab_ M6_thumb.jpg",130,36,1);thumbnails[1236540]=new thumbnail(1236540,"87320","Common Frog","374_com_frog_duckweed_thumb.jpg",130,86,1);thumbnails[4050225]=new thumbnail(4050225,"87323","FENCE SPIDER LEAPING","960_fence_spider_combi_thumb.jpg",130,30,1);thumbnails[1233628]=new thumbnail(1233628,"87321","BARN OWL","458_barn_ owl_m6_thumb.jpg",130,39,1);thumbnails[1235793]=new thumbnail(1235793,"87320","Green Cat Snake","440_green_cat_snake_thumb.jpg",90,130,1);thumbnails[1236528]=new thumbnail(1236528,"87322","WATER VOLE","219_water_ vole_thumb.jpg",130,96,1);thumbnails[1235883]=new thumbnail(1235883,"87321","TAWNY OWL","225_tawny_owl_thumb.jpg",130,93,1);thumbnails[1236510]=new thumbnail(1236510,"87322","Daubenton's Bat","159_daubenton_thumb.jpg",108,130,1);thumbnails[1240809]=new thumbnail(1240809,"87323","Monarch","271_monarch_blu_thumb.jpg",130,90,1);thumbnails[4045216]=new thumbnail(4045216,"87320","PARACHUTE GECKO","958_para_gecko_thumb.jpg",107,130,1);thumbnails[1230229]=new thumbnail(1230229,"87320","Leopard Frog leaping","703_leop_frog_leap_thumb.jpg",106,130,1);thumbnails[1235867]=new thumbnail(1235867,"87321","SWALLOW DRINKING","035_swallow_drink_thumb.jpg",130,93,1);thumbnails[1235868]=new thumbnail(1235868,"87321","ROBIN SINGING","171_ robin_sing_thumb.jpg",130,89,1);thumbnails[1236548]=new thumbnail(1236548,"87322","Red Fox","448_fox_dustbin_thumb.jpg",130,93,1);thumbnails[1235738]=new thumbnail(1235738,"87320","Archer Fish","017_ archer_fish_thumb.jpg",98,130,1);thumbnails[1236582]=new thumbnail(1236582,"87322","Leaping Dormouse","594_dormouse_leap_thumb.jpg",111,130,1);thumbnails[1249714]=new thumbnail(1249714,"87323","Ladybird take-off","191_ladybird_ take-off_thumb.jpg",94,130,1);thumbnails[1236577]=new thumbnail(1236577,"87322","Dormouse","598_dormouse_berri_thumb.jpg",88,130,1);thumbnails[4045177]=new thumbnail(4045177,"87321"," HUMMINGBIRD BATHING","956_hummer_bath_thumb.jpg",105,130,1);thumbnails[4055576]=new thumbnail(4055576,"87320","FIRE-BELLIED TOAD","721_fire_bellied_toad_thumb.jpg",85,130,1);thumbnails[1230122]=new thumbnail(1230122,"87320","Giant Sailfin Dragon","019_sailfin_dragon_thumb.jpg",98,130,1);thumbnails[1240804]=new thumbnail(1240804,"87322","Hedgehog","535_hedghog_thumb.jpg",108,130,1);thumbnails[4034654]=new thumbnail(4034654,"87321","BARN OWL and RAT<br>\r\n","955_owl_rat_thumb.jpg",108,130,1);thumbnails[1230215]=new thumbnail(1230215,"87320","Red-eyed Tree Frog","339_tree_frog_sit_thumb.jpg",130,90,1);thumbnails[1235885]=new thumbnail(1235885,"87321","BARN OWL","543_barn_owl_gallops_thumb.jpg",130,128,1);thumbnails[1240863]=new thumbnail(1240863,"87322","Badger","562_badger_ path_thumb.jpg",107,130,1);thumbnails[1233601]=new thumbnail(1233601,"87321","BLUE TIT LANDING","269_blue_tit_m6_thumb.jpg",130,51,1);thumbnails[1235806]=new thumbnail(1235806,"87320","Marsh Frog","913_marsh_frog1_thumb.jpg",130,101,1);thumbnails[1250483]=new thumbnail(1250483,"87323","Morpho","708_morpho1_thumb.jpg",130,86,1);thumbnails[4050425]=new thumbnail(4050425,"87323","FRUIT FLY over BANANAS","961_fruit__fly_thumb.jpg",130,88,1);thumbnails[1233587]=new thumbnail(1233587,"87321","KINGFISHER","073_kingfisher_thumb.jpg",111,130,1);thumbnails[1235822]=new thumbnail(1235822,"87320","VEILED CHAMELEON","930_veiled_chamel_thumb.jpg",87,130,1);thumbnails[4045239]=new thumbnail(4045239,"87320","FLYING LIZARD","959__drako_thumb.jpg",105,130,1);thumbnails[4050473]=new thumbnail(4050473,"87323","DRONE FLY","962_dronefly_takeoff_thumb.jpg",130,87,1);thumbnails[1235796]=new thumbnail(1235796,"87320","Puff Adder","444_puff_adder_thumb.jpg",99,130,1);thumbnails[1235879]=new thumbnail(1235879,"87320","LEAF-TAILED GECKO","848_leaf_tail_gecko_thumb.jpg",130,89,1);var galleries=new Object();galleries[87321]=new gallery(87321,"4058803,4045177,4034654,1235885,1235883,1235868,1235867,1233635,1233628,1233624","BIRDS","gallery",[1227265,1233588,1233635,4058803,1233624,1233622,1233628,1235883,1235867,1235868,4045177,4034654,1235885,1233601,1233587]);galleries[87323]=new gallery(87323,"4863764,4050473,4050425,4050225,1252988,1250483,1249720,1249714,1243176,1243173","INSECTS & OTHERS","gallery",[1235865,1240795,1240797,1240801,1243150,1243152,1243169,1243173,1243176,1249720,1252988,4863764,1243157,4050225,1240809,1249714,1250483,4050425,4050473]);galleries[87322]=new gallery(87322,"1240863,1240804,1236582,1236577,1236548,1236528,1236510,1236476,1236464,1236390","MAMMALS","gallery",[1227253,1233639,1235748,1236476,1236464,1236390,1236528,1236510,1236548,1236582,1236577,1240804,1240863]);galleries[87320]=new gallery(87320,"4055576,4055387,4055373,4045239,4045216,1236540,1235879,1235822,1235806,1235796","REPTILES, AMPHIBIANS etc","gallery",[1227256,1230104,1235745,4055387,4055373,1236540,1235793,4045216,1230229,1235738,4055576,1230122,1230215,1235806,1235822,4045239,1235796,1235879]);var imageSets=new Object();imageSets[1]="5029223,5029222,4863764,4106457,4080481,4079816,4079742,4079644,4077846,4077660,4058803,4055576,4055387,4055373,4050473,4050425,4050225,4045239,4045216,4045177,4034654,2993999,1252988,1250483,1249720,1249714,1243176,1243173,1243169,1243157,1243152,1243150,1240863,1240809,1240804,1240801,1240797,1240795,1238525,1236582,1236577,1236548,1236540,1236528,1236510,1236476,1236464,1236390,1235885,1235883";imageSets[3]="5029223,5029222,4863764,4106457,4080481,4079816,4079742,4079644,4077846,4077660,4058803,4055576,4055387,4055373,4050473,4050425,4050225,4045239,4045216,4045177,4034654,2993999,1252988,1250483,1249720,1249714,1243176,1243173,1243169,1243157,1243152,1243150,1240863,1240809,1240804,1240801,1240797,1240795,1238525,1236582,1236577,1236548,1236540,1236528,1236510,1236476,1236464,1236390,1235885,1235883";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/stephendalton/images";break}switch(a){case 1:b="http://www1.clikpic.com/stephendalton/images";break}switch(a){case 2:b="http://admin.clikpic.com/stephendalton/images";break}switch(a){case 24:b="http://tpc15/clikpic/stephendalton/images";break}switch(a){case 4:b="http://www.clikchurch.com/stephendalton/images";break}switch(a){case 5:b="http://www2.clikpic.com/stephendalton/images";break}switch(a){case 22:b="http://tpc5/clikpic/stephendalton/images";break}switch(a){case 23:b="http://tpc10/clikpic/stephendalton/images";break}switch(a){case 25:b="http://tpc16/clikpic/stephendalton/images";break}switch(a){case 15:b="http://www3.clikpic.com/stephendalton/images";break}switch(a){case 18:b="http://www4.clikpic.com/stephendalton/images";break}switch(a){case 19:b="http://www5.clikpic.com/stephendalton/images";break}switch(a){case 31:b="http://www7.clikpic.com/stephendalton/images";break}switch(a){case 32:b="http://admin2.clikpic.com/stephendalton/images";break}switch(a){case 33:b="http://www8.clikpic.com/stephendalton/images";break}switch(a){case 34:b="http://www9.clikpic.com/stephendalton/images";break}switch(a){case 35:b="http://admin3.clikpic.com/stephendalton/images";break}switch(a){case 37:b="http://admin4.clikpic.com/stephendalton/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="Stephen Dalton 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>"}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+'")'})}}};