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[1282317]=new thumbnail(1282317,"","Studio","Studio_thumb.jpg",130,98,15);thumbnails[1775074]=new thumbnail(1775074,"119334","Prints","Prints_thumb.JPG",130,98,15);thumbnails[1056209]=new thumbnail(1056209,"","OPMAS Beech 18","DSCF0065_thumb.jpg",130,98,15);thumbnails[1544847]=new thumbnail(1544847,"98466","SNB-5 1951 All Weather Parts","1951SNB-5_thumb.jpg",130,56,15);thumbnails[1056217]=new thumbnail(1056217,"","OPMAS Beech 18 at Booker","DSCF0053_thumb.jpg",130,98,15);thumbnails[1544863]=new thumbnail(1544863,"98466","My panel as received","FullPanel_thumb.jpg",130,98,15);thumbnails[1544909]=new thumbnail(1544909,"98466","Fuel Selector Switch","fuel1_thumb.jpg",130,98,15);thumbnails[1544871]=new thumbnail(1544871,"98466","Some Instruments","DSCF0045_thumb.JPG",130,98,15);thumbnails[1544869]=new thumbnail(1544869,"98466","Close up of Screen-printing","light dimmers_thumb.jpg",130,98,15);thumbnails[1712602]=new thumbnail(1712602,"98466","Painted and populated; so far","instdec07_thumb.jpg",130,76,15);thumbnails[438087]=new thumbnail(438087,"34882","'D-Day Rendezvous'","spit_1_thumb.JPG",130,86,15);thumbnails[438076]=new thumbnail(438076,"34882","DH Dove at Wroughton","DSCF3561_thumb.jpg",130,180,15);thumbnails[438088]=new thumbnail(438088,"34882","Mossie at London Colney","DSCF3567_thumb.jpg",130,127,15);thumbnails[438085]=new thumbnail(438085,"34882","Beech Restorations","DSCF3563_thumb.jpg",130,174,15);thumbnails[459662]=new thumbnail(459662,"34882","Breitling Spitfire","Ray_Hannahs_Spitfire_SMLL_thumb.jpg",130,47,15);thumbnails[1684478]=new thumbnail(1684478,"34882","Ursula","Ursula_thumb.jpg",130,96,15);thumbnails[6033943]=new thumbnail(6033943,"34882","Burmese Thunder","Burmese_Thunder1_thumb.jpg",130,88,15);thumbnails[3656127]=new thumbnail(3656127,"34892","Pacific Harpoons","PV2_thumb.jpg",130,98,15);thumbnails[5283132]=new thumbnail(5283132,"34892","","400_thumb.JPG",130,130,15);thumbnails[1772982]=new thumbnail(1772982,"119057","ASI","KOLLSMAN 0-400_thumb.jpg",130,86,15);thumbnails[2309946]=new thumbnail(2309946,"119057","Clock","DSCF20013_thumb.JPG",130,98,15);thumbnails[2309957]=new thumbnail(2309957,"119057","Radio Altimeter","DSCF2002_thumb.JPG",130,98,15);thumbnails[2309964]=new thumbnail(2309964,"119057","AN-5760-1A","DSCF20032_thumb.JPG",130,98,15);thumbnails[2309977]=new thumbnail(2309977,"119057","ASI","DSCF2004_thumb.JPG",130,98,15);thumbnails[2309981]=new thumbnail(2309981,"119057","14616","DSCF2005_thumb.JPG",130,98,15);thumbnails[2309986]=new thumbnail(2309986,"119057","R88-I-800-11","DSCF2006_thumb.JPG",130,98,15);thumbnails[2309996]=new thumbnail(2309996,"119057","AN-5735-1A","DSCF2008_thumb.JPG",130,98,15);thumbnails[2310006]=new thumbnail(2310006,"119057","AN-5820-1","DSCF2009_thumb.JPG",130,98,15);thumbnails[2310016]=new thumbnail(2310016,"119057","AN-5736-1A","DSCF2010_thumb.JPG",130,98,15);thumbnails[2310023]=new thumbnail(2310023,"119057","R-16-I-2240","DSCF2011_thumb.JPG",130,98,15);thumbnails[2310025]=new thumbnail(2310025,"119057","AN-5530-2A-12","DSCF2012_thumb.JPG",130,98,15);thumbnails[2310027]=new thumbnail(2310027,"119057","AN-5536-2A","DSCF2013_thumb.JPG",130,98,15);thumbnails[2310035]=new thumbnail(2310035,"119057","15463","DSCF2014_thumb.JPG",130,98,15);thumbnails[2310037]=new thumbnail(2310037,"119057","AN-5795-6","DSCF2015_thumb.JPG",130,98,15);thumbnails[2310044]=new thumbnail(2310044,"119057","EA-102-AN10","DSCF2016_thumb.JPG",130,98,15);thumbnails[2310051]=new thumbnail(2310051,"119057","AN-5760-1A","DSCF2017_thumb.JPG",130,98,15);thumbnails[2310059]=new thumbnail(2310059,"119057","AN-5820-1","DSCF2018_thumb.JPG",130,98,15);thumbnails[2310062]=new thumbnail(2310062,"119057","AN/ARN-7 ","DSCF2019_thumb.JPG",130,98,15);thumbnails[2310082]=new thumbnail(2310082,"119057","Wet Compass","DSCF2020_thumb.JPG",130,98,15);thumbnails[2028720]=new thumbnail(2028720,"34892","Lamb's Finish","lamb_thumb.jpg",95,130,15);thumbnails[438074]=new thumbnail(438074,"34892","Sleeping 50's","Sleeping 50s_thumb.jpg",130,130,15);thumbnails[1544896]=new thumbnail(1544896,"119057","Suction Gauge","302d_1_thumb.jpg",130,173,15);thumbnails[3656035]=new thumbnail(3656035,"223374","Cold Start","DSCF22231_thumb.JPG",130,98,15);thumbnails[3656092]=new thumbnail(3656092,"223374","Super Cub","DSCF2228_thumb.JPG",130,52,15);thumbnails[3656105]=new thumbnail(3656105,"223374","Oily Fury","DSCF2229_thumb.JPG",130,126,15);thumbnails[438095]=new thumbnail(438095,"134282","Cold War Fitter ","DSCF3806_thumb.jpg",130,81,15);thumbnails[438158]=new thumbnail(438158,"134282","Lissie at Hendon","DSCF3809_thumb.jpg",130,125,15);thumbnails[438094]=new thumbnail(438094,"134282","David and the Camel","DSCF3803_thumb.jpg",130,189,15);thumbnails[438156]=new thumbnail(438156,"134282","A Red at Scampton","DSCF38081_thumb.jpg",130,84,15);thumbnails[438091]=new thumbnail(438091,"134282","SE5-A","DSCF3800_thumb.jpg",130,96,15);thumbnails[438162]=new thumbnail(438162,"134282","Grob Tutor","Grob Tutor_thumb.jpg",130,86,15);thumbnails[492800]=new thumbnail(492800,"134282","Big Beautiful Doll","DSCF3822_thumb.JPG",130,83,15);thumbnails[1768001]=new thumbnail(1768001,"134282","Staggerwing at Popham","Staggerwing_thumb.JPG",130,81,15);thumbnails[1117155]=new thumbnail(1117155,"134282","Opmas Beech 18","OPMASBeech_thumb.jpg",130,89,15);thumbnails[1124870]=new thumbnail(1124870,"134282","IWM Mk1 Spitfire","spit1_thumb.jpg",130,95,15);thumbnails[653154]=new thumbnail(653154,"134282","Science Museum Spitfire - Mk22","Spit_thumb.JPG",130,87,15);thumbnails[2515470]=new thumbnail(2515470,"34909","Sea Fury G-CBEL","fury_thumb.JPG",98,130,15);thumbnails[438390]=new thumbnail(438390,"34909","F16 Display","DSCF3812_thumb.jpg",130,79,15);thumbnails[438388]=new thumbnail(438388,"34909","Hellcats over the Pacific","DSCF3810_thumb.jpg",130,84,15);thumbnails[438164]=new thumbnail(438164,"34909","Harrier","Harrier_thumb.jpg",130,109,15);thumbnails[2544703]=new thumbnail(2544703,"134296","Compton's Moth","tiger_thumb.JPG",130,98,15);thumbnails[459811]=new thumbnail(459811,"134296","Yeovilton Harrier Sketch","Harrier1_thumb.jpg",130,93,15);var galleries=new Object();galleries[98466]=new gallery(98466,"1712602","1951 All-Weather Instrument Panel","section132202",[1544847,1544863,1544909,1544871,1544869,1712602]);galleries[134283]=new gallery(134283,"1768001","Drawings","gallery",[]);galleries[119334]=new gallery(119334,"1775074","Prints","section156090",[1775074]);galleries[34882]=new gallery(34882,"6033943,438087","Oil Paintings","gallery",[438087,438076,438088,438085,459662,1684478,6033943]);galleries[34892]=new gallery(34892,"5283132,3656127,2028720,438074","acrylic paintings","gallery",[3656127,5283132,2028720,438074]);galleries[119057]=new gallery(119057,"2310082,2310062,2310059,2310051,2310044,2310037,2310035,2310027,2310025,2310023","SNB Instruments","section132202",[1772982,2309946,2309957,2309964,2309977,2309981,2309986,2309996,2310006,2310016,2310023,2310025,2310027,2310035,2310037,2310044,2310051,2310059,2310062,2310082,1544896]);galleries[223374]=new gallery(223374,"3656105,3656092,3656035","Work in Progress","gallery",[3656035,3656092,3656105]);galleries[134282]=new gallery(134282,"1768001","Fine Liner drawings","gallery",[438095,438158,438094,438156,438091,438162,492800,1768001,1117155,1124870,653154]);galleries[34909]=new gallery(34909,"2515470,438390,438388,438164","other media","gallery",[2515470,438390,438388,438164]);galleries[134296]=new gallery(134296,"2544703,459811","Pencil drawings","gallery",[2544703,459811]);var imageSets=new Object();imageSets[1]="1124870,459662,438087";imageSets[2]="6033943,1768001,1712602,1056209,438087";imageSets[3]="6033943,5283132,3656127,3656105,3656092,3656035,2544703,2515470,2310082,2310062,2310059,2310051,2310044,2310037,2310035,2310027,2310025,2310023,2310016,2310006,2309996,2309986,2309981,2309977,2309964,2309957,2309946,2028720,1775074,1772982,1768001,1712602,1684478,1544909,1544896,1544871,1544869,1544863,1544847,1282317,1124870,1117155,1056217,1056209,653154,492800,459811,459662,438390,438388";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/dominicberry/images";break}switch(a){case 1:b="http://www1.clikpic.com/dominicberry/images";break}switch(a){case 2:b="http://admin.clikpic.com/dominicberry/images";break}switch(a){case 24:b="http://tpc15/clikpic/dominicberry/images";break}switch(a){case 4:b="http://www.clikchurch.com/dominicberry/images";break}switch(a){case 5:b="http://www2.clikpic.com/dominicberry/images";break}switch(a){case 22:b="http://tpc5/clikpic/dominicberry/images";break}switch(a){case 23:b="http://tpc10/clikpic/dominicberry/images";break}switch(a){case 25:b="http://tpc16/clikpic/dominicberry/images";break}switch(a){case 15:b="http://www3.clikpic.com/dominicberry/images";break}switch(a){case 18:b="http://www4.clikpic.com/dominicberry/images";break}switch(a){case 19:b="http://www5.clikpic.com/dominicberry/images";break}switch(a){case 31:b="http://www7.clikpic.com/dominicberry/images";break}switch(a){case 32:b="http://admin2.clikpic.com/dominicberry/images";break}switch(a){case 33:b="http://www8.clikpic.com/dominicberry/images";break}switch(a){case 34:b="http://www9.clikpic.com/dominicberry/images";break}switch(a){case 35:b="http://admin3.clikpic.com/dominicberry/images";break}switch(a){case 37:b="http://admin4.clikpic.com/dominicberry/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="Oil, Props and Paint    -    Aviation Art: "+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].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>medium:  </strong>'+photos[b].location+"</p>"}if(photos[b].photographer!=""){a=a+'<p class="imageinfo" id="imagePhotographer"><strong>price for original:  </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  original 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="dberry@thomas-hardye.dorset.sch.uk">';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="dberry@thomas-hardye.dorset.sch.uk">';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+'")'})}}};