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[1993700]=new thumbnail(1993700,"133314","Large Walnut Salad Bowl","Walnut Bowl_thumb.jpg",130,96,5);thumbnails[1993705]=new thumbnail(1993705,"133314","Large Ash Fruit Bowl","Large Ash Bowl_thumb.jpg",130,102,5);thumbnails[1993710]=new thumbnail(1993710,"133314",'Large Sycamore Dish with Bog Oak "Buttons"',"Large Platte with Buttons_thumb.jpg",130,101,5);thumbnails[1993721]=new thumbnail(1993721,"133314",'Large Walnut Platter with Yew "Buttons"',"Large Walnut Platter_thumb.jpg",130,95,5);thumbnails[1993735]=new thumbnail(1993735,"133314","Very Large Ash Platter with Laburnum detail","Inlaid Platter_thumb.jpg",130,98,5);thumbnails[1993776]=new thumbnail(1993776,"133314","Nest of 3 Yew Bowls","Set of 3 Yew Bowls_thumb.jpg",130,102,5);thumbnails[1992677]=new thumbnail(1992677,"133763","Spalted Beech Canker","Spalted Beech Canker_thumb.jpg",130,98,5);thumbnails[1992996]=new thumbnail(1992996,"133763","Leitrim Legend","Lietrim Legend_thumb.jpg",130,65,5);thumbnails[1993644]=new thumbnail(1993644,"133763","Bog Oak Collection","Bog Oak Collection_thumb.jpg",130,90,5);thumbnails[1993647]=new thumbnail(1993647,"133763","Boru's Breakfast Bowl","Boru Breakfast Bowl_thumb.jpg",130,96,5);thumbnails[1993656]=new thumbnail(1993656,"133763","Chieftan's Bowl","Chieftan's Bowl_thumb.jpg",130,88,5);thumbnails[1993660]=new thumbnail(1993660,"133763","Spalted Beech Canker","Canker_thumb.jpg",130,81,5);thumbnails[1993662]=new thumbnail(1993662,"133763",'Elm Burr with a "bite"!',"Bitten Burr_thumb.jpg",130,114,5);thumbnails[1993666]=new thumbnail(1993666,"133763","Small Elm Burr","Small Burr_thumb.jpg",130,98,5);thumbnails[1993696]=new thumbnail(1993696,"133763","Burr Urn","Burr Urn_thumb.jpg",130,95,5);thumbnails[1993793]=new thumbnail(1993793,"133763","Mini Elm Burr","Another Small Burr_thumb.jpg",130,98,5);thumbnails[1992988]=new thumbnail(1992988,"133767","Three Kings","3 Kings_thumb.jpg",130,115,5);thumbnails[1993624]=new thumbnail(1993624,"133767","Extra Large Lazy Suzies in Elm Burr & Ash Burr","Burr Lazy Suzies_thumb.jpg",130,98,5);thumbnails[1993635]=new thumbnail(1993635,"133767","Extra Large Elm Burr Lazy Suzie","Burr Lazy Suzie_thumb.jpg",130,98,5);thumbnails[1993783]=new thumbnail(1993783,"133767","2 Tier Lazy Suzie, sitting on Mirror","2 Tier Lazy Suzie_thumb.jpg",130,127,5);thumbnails[1993804]=new thumbnail(1993804,"133767","Honey Spoons. Tired of dripping honey over the table & getting toast crumbs in the honey jar?","Honey Spoons_thumb.jpg",130,128,5);thumbnails[1993811]=new thumbnail(1993811,"133767","Small Salt & Pepper Grinders","Mini Grinders_thumb.jpg",130,128,5);thumbnails[1993826]=new thumbnail(1993826,"133767","Large Lazy Suzie in use","Lazy Suzie in use_thumb.jpg",130,99,5);thumbnails[1997254]=new thumbnail(1997254,"133767","Walnut Carving Board","Walnut Carving Board_thumb.jpg",130,94,5);thumbnails[1997255]=new thumbnail(1997255,"133767","Small Spalted Cheese Cheeseboards with stainless steel knive","Spalted Beech Cheeseboards_thumb.jpg",130,124,5);thumbnails[2384129]=new thumbnail(2384129,"133767","Yew Pepper Grinder with Salt Dish. Battery operated with downlight shining over food to be seasoned.","Fat Battery Grinder with Salt_thumb.jpg",130,183,5);thumbnails[2384143]=new thumbnail(2384143,"133767","Walnut & Yew Battery powered Pepper grinder, with Salt Dish. It also has a downlight which shines over the food to be seasoned.","Yew Walnut B Grinder & Salt 2_thumb.jpg",130,229,5);thumbnails[1992943]=new thumbnail(1992943,"133764","Burr Apple Boxes","Burr Apple Boxes_thumb.jpg",130,106,5);thumbnails[1992944]=new thumbnail(1992944,"133764","Pocket boxes for the fly fisherman","Fishing Boxes 2_thumb.jpg",130,85,5);thumbnails[1992951]=new thumbnail(1992951,"133764","More Pocket Boxes for the Fly Fisherman!","Fishing Boxes1_thumb.jpg",130,93,5);thumbnails[1993813]=new thumbnail(1993813,"133318","Light Bowl","Light Bowl_thumb.jpg",130,104,5);thumbnails[1993817]=new thumbnail(1993817,"133318","Light Bowl at Night","Light Bowl Night_thumb.jpg",130,104,5);thumbnails[1997258]=new thumbnail(1997258,"133318",'"Capricorn" Lamp made of Bog Pine and Ostrich Egg',"Capricorn lit_thumb.jpg",130,186,5);thumbnails[2000316]=new thumbnail(2000316,"133318","Bedside Lamps painted with Verdigris finish","Bedside Lamps_thumb.jpg",130,151,5);thumbnails[2000318]=new thumbnail(2000318,"133318",'Oak Lamp with "bog oak" finish',"Lamp Dark Oak_thumb.jpg",130,180,5);thumbnails[2000320]=new thumbnail(2000320,"133318","Oak Lamp with natural finish","Lamp Light Oak_thumb.jpg",130,153,5);thumbnails[1997263]=new thumbnail(1997263,"133319",'"The Warren"  Coffee table with plate glass top sitting on old Beech Root. Set in with LED lights and rechargeable battery.',"Warren & Coffee_thumb.jpg",130,119,5);thumbnails[2000314]=new thumbnail(2000314,"133319",'"The Warren" at night with LED lights lit',"The Warren at Night_thumb.jpg",130,101,5);thumbnails[2000315]=new thumbnail(2000315,"133319","Side Table with Verdigris Copper legs and Verdigris paint finish","Verdigris Table_thumb.jpg",130,208,5);thumbnails[1993819]=new thumbnail(1993819,"133766","3 small Burr Candlesticks","Candlesticks_thumb.jpg",130,77,5);thumbnails[1993821]=new thumbnail(1993821,"133766","Hunting Horns of different timbers, sitting on an Elm Burr Dish","Hunting Horns_thumb.jpg",130,98,5);thumbnails[1993823]=new thumbnail(1993823,"133766","Blow your own Hunting Horn.","Hunting Horns 2_thumb.jpg",130,98,5);thumbnails[1994186]=new thumbnail(1994186,"133766","For the Tack Room. These hooks are screwed to the wall and can be used to hang things in the house as well as the Stable","Bridle on hook_thumb.jpg",130,285,5);thumbnails[1997270]=new thumbnail(1997270,"133766",'Ingenious gadget for making newspaper pots for your seedlings. Totally biodegradeable and more eco friendly than peat pots. "POT OFF THE PRESS"',"Pot off the  Press 1_thumb.jpg",130,139,5);thumbnails[1997274]=new thumbnail(1997274,"133765","Ash Bowl with Yew, Bog Oak, and Walnut decoration on rim. 46cm diameter","41cm Ash Bowl + Yew Walnut Bog Oak Decoration_thumb.jpg",130,106,5);thumbnails[1997279]=new thumbnail(1997279,"133765","Elm Burr Bowl, with feature hole in the side. 41cm diameter","41cm Elm Burr Bowl 2_thumb.jpg",130,83,5);thumbnails[1997287]=new thumbnail(1997287,"133765","Ash Bowl with Yew decoration set into outside. 46cm diameter","46cm Ash Bowl with Yew Decoration 2_thumb.jpg",130,82,5);thumbnails[1997290]=new thumbnail(1997290,"133765","Sycamore Bowl with Bog Oak decoration set onto rim. 43cm diameter","43cm Sycamore Bowl with Bog Oak Decoration 2_thumb.jpg",130,91,5);thumbnails[1997293]=new thumbnail(1997293,"133765","Walnut Collection. Bowls ranging between 27cm & 22cm diameter","Walnut Collection 27 to 22cm 2_thumb.jpg",130,82,5);thumbnails[1997295]=new thumbnail(1997295,"133765","Ash Collection: Bowl of 28cm diameter and dish 19cm diameter","Ash Collection 28 and 19cm_thumb.jpg",130,113,5);thumbnails[1997296]=new thumbnail(1997296,"133765","Sycamore Collection: Bowls of diameter 27 & 24cm diameter","Sycamore Collection 27 and 24cm 2_thumb.jpg",130,100,5);thumbnails[2384044]=new thumbnail(2384044,"133765","Battery powered Pepper grinders sitting on a Salt dish. For more details see Kitchen Gadgets Gallery","Pair of Battery Grinders_thumb.jpg",130,162,5);thumbnails[5495451]=new thumbnail(5495451,"310635","The Muppet","Muppet_2_thumb.jpg",130,128,5);thumbnails[5495465]=new thumbnail(5495465,"310635","Pasha","Pasha_2_thumb.jpg",130,128,5);thumbnails[5495481]=new thumbnail(5495481,"310635","Luna","Luna_2_thumb.jpg",130,121,5);thumbnails[5495494]=new thumbnail(5495494,"310635","Percy","percy_2_thumb.jpg",130,179,5);thumbnails[5495500]=new thumbnail(5495500,"310635","Bing","Bing_21_thumb.jpg",130,170,5);thumbnails[5517672]=new thumbnail(5517672,"310635","Magic & Poppy","17_feb_web_thumb.jpg",130,132,5);thumbnails[5517778]=new thumbnail(5517778,"310635","Apple & Toffee","ToffeApple_web_thumb.jpg",130,131,5);var galleries=new Object();galleries[133314]=new gallery(133314,"1993776,1993735,1993721,1993710,1993705,1993700","Bowls & Platters","gallery",[1993700,1993705,1993710,1993721,1993735,1993776]);galleries[133763]=new gallery(133763,"1993644,1992996","Decorative Bowls","gallery",[1992677,1992996,1993644,1993647,1993656,1993660,1993662,1993666,1993696,1993793]);galleries[133767]=new gallery(133767,"1992988","Kitchen Gadgets","gallery",[1992988,1993624,1993635,1993783,1993804,1993811,1993826,1997254,1997255,2384129,2384143]);galleries[133764]=new gallery(133764,"1992951,1992944,1992943","Boxes","gallery",[1992943,1992944,1992951]);galleries[133318]=new gallery(133318,"1997258","Lamps","gallery",[1993813,1993817,1997258,2000316,2000318,2000320]);galleries[133319]=new gallery(133319,"1997263","Furniture","gallery",[1997263,2000314,2000315]);galleries[133766]=new gallery(133766,"1993821","Other","gallery",[1993819,1993821,1993823,1994186,1997270]);galleries[133765]=new gallery(133765,"1997287","NEW !","gallery",[1997274,1997279,1997287,1997290,1997293,1997295,1997296,2384044]);galleries[310635]=new gallery(310635,"5517778,5517672,5495500,5495494,5495481,5495465,5495451","Animal Portraits","gallery",[5495451,5495465,5495481,5495494,5495500,5517672,5517778]);var imageSets=new Object();imageSets[1]="1992677";imageSets[2]="1997287,1997263,1997258,1993821,1993644,1992996,1992988";imageSets[3]="5517778,5517672,5495500,5495494,5495481,5495465,5495451,2384143,2384129,2384044,2000320,2000318,2000316,2000315,2000314,1997296,1997295,1997293,1997290,1997287,1997279,1997274,1997270,1997263,1997258,1997255,1997254,1994186,1993826,1993823,1993821,1993819,1993817,1993813,1993811,1993804,1993793,1993783,1993776,1993735,1993721,1993710,1993705,1993700,1993696,1993666,1993662,1993660,1993656,1993647";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/outofyourtree/images";break}switch(a){case 1:b="http://www1.clikpic.com/outofyourtree/images";break}switch(a){case 2:b="http://admin.clikpic.com/outofyourtree/images";break}switch(a){case 24:b="http://tpc15/clikpic/outofyourtree/images";break}switch(a){case 4:b="http://www.clikchurch.com/outofyourtree/images";break}switch(a){case 5:b="http://www2.clikpic.com/outofyourtree/images";break}switch(a){case 22:b="http://tpc5/clikpic/outofyourtree/images";break}switch(a){case 23:b="http://tpc10/clikpic/outofyourtree/images";break}switch(a){case 25:b="http://tpc16/clikpic/outofyourtree/images";break}switch(a){case 15:b="http://www3.clikpic.com/outofyourtree/images";break}switch(a){case 18:b="http://www4.clikpic.com/outofyourtree/images";break}switch(a){case 19:b="http://www5.clikpic.com/outofyourtree/images";break}switch(a){case 31:b="http://www7.clikpic.com/outofyourtree/images";break}switch(a){case 32:b="http://admin2.clikpic.com/outofyourtree/images";break}switch(a){case 33:b="http://www8.clikpic.com/outofyourtree/images";break}switch(a){case 34:b="http://www9.clikpic.com/outofyourtree/images";break}switch(a){case 35:b="http://admin3.clikpic.com/outofyourtree/images";break}switch(a){case 37:b="http://admin4.clikpic.com/outofyourtree/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="Out of Your Tree - Woodturners: "+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>"}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+'")'})}}};