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[3578195]=new thumbnail(3578195,"217668","Reflections","www__019_thumb.jpg",130,97,15);thumbnails[3578198]=new thumbnail(3578198,"217668","Near North Cave Wetlands","bbb__021_thumb.jpg",130,97,15);thumbnails[3578218]=new thumbnail(3578218,"217668","Kings of the Water","kingfive1_thumb.JPG",130,87,15);thumbnails[3578221]=new thumbnail(3578221,"217668","On Fire","wet__006_thumb.jpg",130,97,15);thumbnails[3578222]=new thumbnail(3578222,"217668","Peace","SUNSET__017_thumb.jpg",130,174,15);thumbnails[3578233]=new thumbnail(3578233,"217668","Elevenses","band__010_thumb.jpg",130,97,15);thumbnails[3578244]=new thumbnail(3578244,"217668","Evening View","SUNSET__024_thumb.jpg",130,97,15);thumbnails[3647051]=new thumbnail(3647051,"217668","Find your way around","map_of_wetlands029_thumb.jpg",130,172,15);thumbnails[3796090]=new thumbnail(3796090,"217668","Welcome Break from Bird Watching","IMG_0900_thumb.JPG",130,87,15);thumbnails[3796105]=new thumbnail(3796105,"217668","Hiding in a Hide !","IMG_0907_thumb.JPG",130,87,15);thumbnails[3796110]=new thumbnail(3796110,"217668","Party in the Turret Hide","IMG_0920_thumb.JPG",130,87,15);thumbnails[3796116]=new thumbnail(3796116,"217668","Sunset over the Wetlands","IMG_0911_thumb.JPG",130,195,15);thumbnails[3796189]=new thumbnail(3796189,"217668","Fred's Walkers","IMG_0923_thumb.JPG",130,87,15);thumbnails[3796197]=new thumbnail(3796197,"217668","Yorkshire Wildlife Trust Open Day","IMG_0921_thumb.JPG",130,87,15);thumbnails[3827575]=new thumbnail(3827575,"217668","Tea for Two,Three, Four and more !!!","IMG_0924_thumb.JPG",130,87,15);thumbnails[4316426]=new thumbnail(4316426,"217668","Feed me......feed me !","03-07-09PiedWagNCave00001_thumb.jpg",130,58,15);thumbnails[4316427]=new thumbnail(4316427,"217668","Going ga ga !","garganey81_thumb.jpg",130,87,15);thumbnails[4316428]=new thumbnail(4316428,"217668","Whoopers.......or WILDBIRD WHOPPERS ....","whooperswan7a1_thumb.jpg",130,34,15);thumbnails[4316429]=new thumbnail(4316429,"217668","Wood... you like to see my reflection?","woodsandpiper31_thumb.jpg",130,87,15);thumbnails[4360367]=new thumbnail(4360367,"217668","Hair today.......gone in a flash !","Birds09181_thumb.jpg",130,87,15);thumbnails[4360369]=new thumbnail(4360369,"217668","Flying high","Birds09335_thumb.jpg",130,86,15);thumbnails[4360372]=new thumbnail(4360372,"217668","Mother and child doing well .............","Birds09377_thumb.jpg",130,87,15);thumbnails[4360375]=new thumbnail(4360375,"217668","Looking for Cider maybe ??","greenwoodpecker6_thumb.jpg",130,87,15);thumbnails[4360379]=new thumbnail(4360379,"217668","Spots? Who are you calling spotty!!","gswoodpecker2_thumb.jpg",130,195,15);thumbnails[3615044]=new thumbnail(3615044,"217669","Too Lazy to swim","littlegrebe21_thumb.jpg",130,86,15);thumbnails[3620658]=new thumbnail(3620658,"217669","Chased by a Devil","redkite14_thumb.jpg",130,87,15);thumbnails[3620662]=new thumbnail(3620662,"217669","Waiting for Breakfast","wren2_thumb.jpg",130,86,15);thumbnails[3620724]=new thumbnail(3620724,"217669","Green Winged Teal - Odd one Out","Green-wingedTealNorthCaveWeltandsEastYorks030209_thumb.jpg",130,130,15);thumbnails[3620727]=new thumbnail(3620727,"217669","Watching ","ringplover2ncw060309crop_thumb.jpg",130,95,15);thumbnails[3620733]=new thumbnail(3620733,"217669","What are you looking at?","JuvenileGreyWagtail_thumb.jpg",130,104,15);thumbnails[3647053]=new thumbnail(3647053,"217669","Kestrel Resting !","Kestrel_at_ncave_thumb.jpg",130,91,15);thumbnails[3673944]=new thumbnail(3673944,"217669","Fluffy ball on a Lolly Stick !","long_tail037_thumb.jpg",130,183,15);thumbnails[3673947]=new thumbnail(3673947,"217669","This is MY path","stoat0311_thumb.jpg",130,87,15);thumbnails[3673948]=new thumbnail(3673948,"217669","Don't swim in the Lake","snake034_thumb.jpg",130,90,15);thumbnails[3673950]=new thumbnail(3673950,"217669","Waiting to be fed","kings041_thumb.jpg",130,87,15);thumbnails[3673955]=new thumbnail(3673955,"217669","Where's the Bar?","goose0401_thumb.jpg",130,91,15);thumbnails[3673960]=new thumbnail(3673960,"217669","Angels of The North Cave Wetlands","angels032_thumb.jpg",130,91,15);thumbnails[3673961]=new thumbnail(3673961,"217669","Who has the longest Beak?","Avocet_resized_thumb.jpg",130,93,15);thumbnails[3673962]=new thumbnail(3673962,"217669","The Wind behind me","Lapwing_resized_thumb.jpg",130,93,15);thumbnails[3673965]=new thumbnail(3673965,"217669","Look at my wings","chaffinch_resized_thumb.jpg",130,180,15);thumbnails[3673970]=new thumbnail(3673970,"217669","So what.....?","gcgresized_thumb.jpg",130,93,15);thumbnails[3696077]=new thumbnail(3696077,"217669","Anyone got a hairbrush?","great_crested_thumb.jpg",130,86,15);thumbnails[3715285]=new thumbnail(3715285,"217669","Those Ruddy Ducks !!!","bryan_4_thumb.jpg",130,98,15);thumbnails[3715297]=new thumbnail(3715297,"217669","Slightly unbalanced !!","steve_5_thumb.jpg",130,82,15);thumbnails[3804273]=new thumbnail(3804273,"217669","Red Legs","Redshank_1_resized_thumb.jpg",130,94,15);thumbnails[3961493]=new thumbnail(3961493,"217669","More than I can chew???","whitethroat12_thumb.jpg",130,87,15);thumbnails[3961508]=new thumbnail(3961508,"217669","In the Meadow","birdso9054_thumb.jpg",130,98,15);thumbnails[3961531]=new thumbnail(3961531,"217669","Look how handsome I am !!!","DSC00384_thumb.JPG",130,180,15);thumbnails[3988362]=new thumbnail(3988362,"217669","Should I be in a Clock??","cuckoomike_thumb.jpg",130,86,15);thumbnails[3988368]=new thumbnail(3988368,"217669","Little Gull with a big reflection","littlegullmike_thumb.jpg",130,196,15);thumbnails[4143908]=new thumbnail(4143908,"217669","All the way from North America for a snack!","spottedsandpiper4_thumb.jpg",130,86,15);thumbnails[4311229]=new thumbnail(4311229,"217669","Feed Me............Feed Me !!","03-07-09PiedWagNCave0000_thumb.jpg",130,58,15);thumbnails[4311235]=new thumbnail(4311235,"217669","Ga Ga Bird !!","garganey8_thumb.jpg",130,87,15);thumbnails[4311269]=new thumbnail(4311269,"217669","Wood....you like to see a reflection !!","woodsandpiper3_thumb.jpg",130,87,15);thumbnails[4311302]=new thumbnail(4311302,"217669","Six Swans a swimming.......or are they WILDBIRD WHOPPERS !!","whooperswan7a_thumb.jpg",130,34,15);thumbnails[4405920]=new thumbnail(4405920,"217669","Looking for Treasure","P5240689_thumb.JPG",130,97,15);thumbnails[4405925]=new thumbnail(4405925,"217669","King of the Pond","P7201240_thumb.JPG",130,97,15);thumbnails[4571338]=new thumbnail(4571338,"217669","Breakfast has BEEN served OK !","piedwagtails_thumb.JPG",130,98,15);thumbnails[4571350]=new thumbnail(4571350,"217669","Go away.......we are having a meeting","shelducksandlapwing_thumb.JPG",130,97,15);thumbnails[4571411]=new thumbnail(4571411,"217669","Can you see me ?","Robin_thumb.JPG",130,97,15);thumbnails[4571422]=new thumbnail(4571422,"217669","Too bright to hide away","Bullfinch_thumb.JPG",130,97,15);thumbnails[4571430]=new thumbnail(4571430,"217669","Marbles?","MarbledWhiteB_thumb.jpg",130,87,15);thumbnails[4571434]=new thumbnail(4571434,"217669","Common...who me?","CommonBlue_thumb.JPG",130,87,15);thumbnails[4571441]=new thumbnail(4571441,"217669","Brimstone and Treacle!","BrimstoneB_thumb.jpg",130,86,15);var galleries=new Object();galleries[217668]=new gallery(217668,"4360379,4360375,4360372,4360369,4360367,4316429,4316428,4316427,4316426,3827575","North Cave Wetlands","gallery",[3578195,3578198,3578218,3578221,3578222,3578233,3578244,3647051,3796090,3796105,3796110,3796116,3796189,3796197,3827575,4316426,4316427,4316428,4316429,4360367,4360369,4360372,4360375,4360379]);galleries[217669]=new gallery(217669,"4571441,4571434,4571430,4571422,4571411,4571350,4571338,4405925,4405920,4311302","Photos from Visitors","gallery",[3615044,3620658,3620662,3620724,3620727,3620733,3647053,3673944,3673947,3673948,3673950,3673955,3673960,3673961,3673962,3673965,3673970,3696077,3715285,3715297,3804273,3961493,3961508,3961531,3988362,3988368,4143908,4311229,4311235,4311269,4311302,4405920,4405925,4571338,4571350,4571411,4571422,4571430,4571434,4571441]);var imageSets=new Object();imageSets[1]="3961508,3961493,3827575,3673944,3578244,3578222,3578218,3578198";imageSets[3]="4571441,4571434,4571430,4571422,4571411,4571350,4571338,4405925,4405920,4360379,4360375,4360372,4360369,4360367,4316429,4316428,4316427,4316426,4311302,4311269,4311235,4311229,4143908,3988368,3988362,3961531,3961508,3961493,3827575,3804273,3796197,3796189,3796116,3796110,3796105,3796090,3715297,3715285,3696077,3673970,3673965,3673962,3673961,3673960,3673955,3673950,3673948,3673947,3673944,3647053";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/wildbird/images";break}switch(a){case 1:b="http://www1.clikpic.com/wildbird/images";break}switch(a){case 2:b="http://admin.clikpic.com/wildbird/images";break}switch(a){case 24:b="http://tpc15/clikpic/wildbird/images";break}switch(a){case 4:b="http://www.clikchurch.com/wildbird/images";break}switch(a){case 5:b="http://www2.clikpic.com/wildbird/images";break}switch(a){case 22:b="http://tpc5/clikpic/wildbird/images";break}switch(a){case 23:b="http://tpc10/clikpic/wildbird/images";break}switch(a){case 25:b="http://tpc16/clikpic/wildbird/images";break}switch(a){case 15:b="http://www3.clikpic.com/wildbird/images";break}switch(a){case 18:b="http://www4.clikpic.com/wildbird/images";break}switch(a){case 19:b="http://www5.clikpic.com/wildbird/images";break}switch(a){case 31:b="http://www7.clikpic.com/wildbird/images";break}switch(a){case 32:b="http://admin2.clikpic.com/wildbird/images";break}switch(a){case 33:b="http://www8.clikpic.com/wildbird/images";break}switch(a){case 34:b="http://www9.clikpic.com/wildbird/images";break}switch(a){case 35:b="http://admin3.clikpic.com/wildbird/images";break}switch(a){case 37:b="http://admin4.clikpic.com/wildbird/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="The Wild Bird Cafe: "+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+'")'})}}};
