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[661130]=new thumbnail(661130,"50068","","IMG_9828_thumb.jpg",130,87,15);thumbnails[661143]=new thumbnail(661143,"50068","","IMG_9649_thumb.jpg",130,87,15);thumbnails[661147]=new thumbnail(661147,"50070","","IMG_04641_thumb.jpg",130,87,15);thumbnails[665544]=new thumbnail(665544,"50068","","IMG_0061_thumb.jpg",130,87,15);thumbnails[665550]=new thumbnail(665550,"50070","","IMG_0383_thumb.jpg",130,87,15);thumbnails[665551]=new thumbnail(665551,"50070","","IMG_04051_thumb.jpg",130,87,15);thumbnails[665552]=new thumbnail(665552,"50068","","IMG_9603_thumb.jpg",130,87,15);thumbnails[665629]=new thumbnail(665629,"50068","","IMG_9681_thumb.jpg",130,87,15);thumbnails[665631]=new thumbnail(665631,"50068","","IMG_9653_thumb.jpg",130,87,15);thumbnails[665639]=new thumbnail(665639,"50068","","IMG_9940_thumb.jpg",130,87,15);thumbnails[683325]=new thumbnail(683325,"50071","","img_0273_thumb.jpg",130,87,15);thumbnails[683326]=new thumbnail(683326,"50071","","img_0288_thumb.jpg",130,87,15);thumbnails[683328]=new thumbnail(683328,"50071","","img_0190_thumb.jpg",130,87,15);thumbnails[683329]=new thumbnail(683329,"50071","","img_0307_thumb.jpg",130,87,15);thumbnails[683330]=new thumbnail(683330,"50072","","IMG_3140_thumb.jpg",130,87,15);thumbnails[683333]=new thumbnail(683333,"50070","","IMG_0318_thumb.jpg",130,87,15);thumbnails[683335]=new thumbnail(683335,"50072","","img_0477_thumb.jpg",130,87,15);thumbnails[683337]=new thumbnail(683337,"50072","","IMG_2809_thumb.jpg",130,87,15);thumbnails[683338]=new thumbnail(683338,"50070","","IMG_3984_thumb.jpg",130,87,15);thumbnails[683339]=new thumbnail(683339,"50072","","IMG_6935_thumb.jpg",130,87,15);thumbnails[683340]=new thumbnail(683340,"50072","","IMG_6961_thumb.jpg",130,87,15);thumbnails[683349]=new thumbnail(683349,"50071","","img_9907_thumb.jpg",130,87,15);thumbnails[683350]=new thumbnail(683350,"50071","","img_9916_thumb.jpg",130,87,15);thumbnails[683353]=new thumbnail(683353,"50070","","IMG_8148_thumb.jpg",130,87,15);thumbnails[808061]=new thumbnail(808061,"62628","","IMG_0417_thumb.JPG",130,87,15);thumbnails[808063]=new thumbnail(808063,"62628","","IMG_04631_thumb.JPG",130,87,15);thumbnails[808066]=new thumbnail(808066,"62628","","IMG_0793_thumb.JPG",130,87,15);thumbnails[808072]=new thumbnail(808072,"62628","","IMG_0708_thumb.JPG",130,87,15);thumbnails[808074]=new thumbnail(808074,"62628","","IMG_0897_thumb.JPG",130,87,15);thumbnails[808078]=new thumbnail(808078,"62628","","IMG_3326_thumb.JPG",130,87,15);thumbnails[808080]=new thumbnail(808080,"62628","","IMG_3598_thumb.JPG",130,87,15);thumbnails[808082]=new thumbnail(808082,"62628","","IMG_0915_thumb.JPG",130,87,15);thumbnails[808084]=new thumbnail(808084,"62628","","IMG_3287_thumb.JPG",130,87,15);thumbnails[808087]=new thumbnail(808087,"62628","","IMG_3427_thumb.JPG",130,87,15);thumbnails[808089]=new thumbnail(808089,"62628","","IMG_3706_thumb.JPG",130,87,15);thumbnails[808093]=new thumbnail(808093,"62628","","IMG_3550_thumb.JPG",130,87,15);thumbnails[808095]=new thumbnail(808095,"62628","","IMG_3395_thumb.JPG",130,87,15);thumbnails[808096]=new thumbnail(808096,"62628","","IMG_3305_thumb.JPG",130,87,15);thumbnails[808099]=new thumbnail(808099,"62628","","IMG_0577_thumb.JPG",130,87,15);thumbnails[808100]=new thumbnail(808100,"62628","","IMG_3437_thumb.JPG",130,87,15);thumbnails[808102]=new thumbnail(808102,"62628","","IMG_0838_thumb.JPG",130,87,15);thumbnails[808103]=new thumbnail(808103,"62628","","IMG_0440_thumb.JPG",130,195,15);thumbnails[808104]=new thumbnail(808104,"62628","","IMG_0597_thumb.JPG",130,195,15);thumbnails[1170033]=new thumbnail(1170033,"50072","","CRW_0059s_thumb.jpg",130,87,15);thumbnails[1170034]=new thumbnail(1170034,"50070","","IMG_0128s_thumb.jpg",130,87,15);thumbnails[1170036]=new thumbnail(1170036,"50070","","IMG_0044s_thumb.jpg",130,87,15);thumbnails[1170041]=new thumbnail(1170041,"50070","","IMG_0449s_thumb.jpg",130,87,15);thumbnails[1170044]=new thumbnail(1170044,"50072","","IMG_1669s_thumb.jpg",130,87,15);thumbnails[1170047]=new thumbnail(1170047,"50072","","IMG_2020s_thumb.jpg",130,87,15);thumbnails[1170050]=new thumbnail(1170050,"50070","","IMG_2450s_thumb.jpg",130,87,15);thumbnails[1170053]=new thumbnail(1170053,"50070","","IMG_2680s_thumb.jpg",130,87,15);thumbnails[1170055]=new thumbnail(1170055,"50070","","IMG_2794s_thumb.jpg",130,87,15);thumbnails[1170058]=new thumbnail(1170058,"50070","","IMG_3908s_thumb.jpg",130,87,15);thumbnails[1170062]=new thumbnail(1170062,"50070","","IMG_4200s_thumb.jpg",130,87,15);thumbnails[1170065]=new thumbnail(1170065,"50072","","IMG_7254s_thumb.jpg",130,87,15);thumbnails[1170067]=new thumbnail(1170067,"50068","","NJD_0114s_thumb.jpg",130,87,15);thumbnails[1170114]=new thumbnail(1170114,"50070","","IMG_9734s_thumb.jpg",130,87,15);thumbnails[1686872]=new thumbnail(1686872,"","","img_9916s_thumb.jpg",130,87,15);thumbnails[1858161]=new thumbnail(1858161,"50072","","A1_thumb.jpg",130,87,15);thumbnails[1858162]=new thumbnail(1858162,"50072","","A2_thumb.jpg",130,87,15);thumbnails[1858163]=new thumbnail(1858163,"50072","","A3_thumb.jpg",130,87,15);thumbnails[1858164]=new thumbnail(1858164,"50072","","A6_thumb.jpg",130,87,15);thumbnails[1858165]=new thumbnail(1858165,"50072","","A5_thumb.jpg",130,87,15);thumbnails[1858166]=new thumbnail(1858166,"50072","","A4_thumb.jpg",130,87,15);thumbnails[1858167]=new thumbnail(1858167,"50070","","A7_thumb.jpg",130,87,15);thumbnails[1858168]=new thumbnail(1858168,"50070","","A8_thumb.jpg",130,87,15);thumbnails[1858169]=new thumbnail(1858169,"50072","","A9_thumb.jpg",130,87,15);thumbnails[1858170]=new thumbnail(1858170,"50072","","A10_thumb.jpg",130,87,15);thumbnails[1858171]=new thumbnail(1858171,"50070","","A12_thumb.jpg",130,87,15);thumbnails[1858173]=new thumbnail(1858173,"50068","","A11_thumb.jpg",130,87,15);thumbnails[3313643]=new thumbnail(3313643,"201947","","NDunridge-Hawgsmoke-19w_thumb.jpg",130,87,15);thumbnails[3313644]=new thumbnail(3313644,"201947","","NDunridge-Hawgsmoke-6w_thumb.jpg",130,87,15);thumbnails[3313649]=new thumbnail(3313649,"201947","","NDunridge-Hawgsmoke-32w_thumb.jpg",130,87,15);thumbnails[3313650]=new thumbnail(3313650,"201947","","NDunridge-Hawgsmoke-2w_thumb.jpg",130,87,15);thumbnails[3313655]=new thumbnail(3313655,"201947","","NDunridge-Hawgsmoke-43w_thumb.jpg",130,87,15);thumbnails[3313656]=new thumbnail(3313656,"201947","","NDunridge-Hawgsmoke-3w_thumb.jpg",130,87,15);thumbnails[3313657]=new thumbnail(3313657,"201947","","NDunridge-Hawgsmoke-5w_thumb.jpg",130,87,15);thumbnails[3313666]=new thumbnail(3313666,"201947","","NDunridge-Hawgsmoke-9s_thumb.jpg",130,87,15);thumbnails[3313647]=new thumbnail(3313647,"201947","","NDunridge-Hawgsmoke-18w_thumb.jpg",130,195,15);thumbnails[3313646]=new thumbnail(3313646,"201947","","NDunridge-Hawgsmoke-11w_thumb.jpg",130,195,15);thumbnails[3313658]=new thumbnail(3313658,"201947","","NDunridge-Hawgsmoke-10w_thumb.jpg",130,195,15);thumbnails[1170037]=new thumbnail(1170037,"50066","","img_0133s_thumb.jpg",130,87,15);thumbnails[1169882]=new thumbnail(1169882,"50066","","img_0036s_thumb.jpg",130,87,15);thumbnails[1169901]=new thumbnail(1169901,"50066","","img_0006s_thumb.jpg",130,87,15);thumbnails[1169890]=new thumbnail(1169890,"50066","","img_0039s_thumb.jpg",130,87,15);thumbnails[1169897]=new thumbnail(1169897,"50066","","img_0003s_thumb.jpg",130,87,15);thumbnails[1169891]=new thumbnail(1169891,"50066","","img_0042s_thumb.jpg",130,87,15);thumbnails[661136]=new thumbnail(661136,"50181","","IMG_01111_thumb.jpg",130,87,15);thumbnails[665546]=new thumbnail(665546,"50181","","IMG_0155_thumb.jpg",130,87,15);thumbnails[665547]=new thumbnail(665547,"50181","","IMG_01131_thumb.jpg",130,87,15);thumbnails[1170105]=new thumbnail(1170105,"50181","","IMG_8259s_thumb.jpg",130,87,15);thumbnails[1170107]=new thumbnail(1170107,"50181","","IMG_8295s_thumb.jpg",130,87,15);thumbnails[1170109]=new thumbnail(1170109,"50181","","IMG_9300_thumb.JPG",130,87,15);thumbnails[1170111]=new thumbnail(1170111,"50181","","IMG_9314s_thumb.jpg",130,87,15);thumbnails[1170113]=new thumbnail(1170113,"50181","","IMG_9467s_thumb.jpg",130,87,15);var galleries=new Object();galleries[201947]=new gallery(201947,"3313666,3313658,3313657,3313656,3313655,3313650,3313649,3313647,3313646,3313644","Hawgsmoke 2008","gallery",[3313643,3313644,3313649,3313650,3313655,3313656,3313657,3313666,3313647,3313646,3313658]);galleries[50072]=new gallery(50072,"1858170,1858169,1858166,1858165,1858164,1858163,1858162,1858161,1170065,1170047","Miscellaneous","gallery",[683330,683335,683337,683339,683340,1170033,1170044,1170047,1170065,1858161,1858162,1858163,1858164,1858165,1858166,1858169,1858170]);galleries[50068]=new gallery(50068,"1858173,1170067,665639,665631,665629,665552,665544,661143,661130","Operation Iraqi Freedom","gallery",[661130,661143,665544,665552,665629,665631,665639,1170067,1858173]);galleries[50070]=new gallery(50070,"1858171,1858168,1858167,1170114,1170062,1170058,1170055,1170053,1170050,1170041","Royal Air Force","gallery",[661147,665550,665551,683333,683338,683353,1170034,1170036,1170041,1170050,1170053,1170055,1170058,1170062,1170114,1858167,1858168,1858171]);galleries[62628]=new gallery(62628,"808104,808103,808102,808100,808099,808096,808095,808093,808089,808087","USS Eisenhower - Op Enduring Freedom","gallery",[808061,808063,808066,808072,808074,808078,808080,808082,808084,808087,808089,808093,808095,808096,808099,808100,808102,808103,808104]);galleries[50071]=new gallery(50071,"683350,683349,683329,683328,683326,683325","Warbirds","gallery",[683325,683326,683328,683329,683349,683350]);galleries[50066]=new gallery(50066,"1170037,1169901,1169897,1169891,1169890,1169882","Blue Angels","gallery",[1170037,1169882,1169901,1169890,1169897,1169891]);galleries[50181]=new gallery(50181,"1170113,1170111,1170109,1170107,1170105,665547,665546,661136","Tomcats Last Stand","gallery",[661136,665546,665547,1170105,1170107,1170109,1170111,1170113]);var imageSets=new Object();imageSets[1]="1686872";imageSets[3]="3313666,3313658,3313657,3313656,3313655,3313650,3313649,3313647,3313646,3313644,3313643,1858173,1858171,1858170,1858169,1858168,1858167,1858166,1858165,1858164,1858163,1858162,1858161,1686872,1170114,1170113,1170111,1170109,1170107,1170105,1170067,1170065,1170062,1170058,1170055,1170053,1170050,1170047,1170044,1170041,1170037,1170036,1170034,1170033,1169901,1169897,1169891,1169890,1169882,808104";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 34:b="http://www9.clikpic.com/ndunridge/images";break}switch(a){case 1:b="http://www1.clikpic.com/ndunridge/images";break}switch(a){case 2:b="http://admin.clikpic.com/ndunridge/images";break}switch(a){case 4:b="http://www.clikchurch.com/ndunridge/images";break}switch(a){case 5:b="http://www2.clikpic.com/ndunridge/images";break}switch(a){case 15:b="http://www3.clikpic.com/ndunridge/images";break}switch(a){case 21:b="http://www6.clikpic.com/ndunridge/images";break}switch(a){case 18:b="http://www4.clikpic.com/ndunridge/images";break}switch(a){case 19:b="http://www5.clikpic.com/ndunridge/images";break}switch(a){case 22:b="http://tpc5/clikpic/ndunridge/images";break}switch(a){case 23:b="http://tpc10/clikpic/ndunridge/images";break}switch(a){case 24:b="http://tpc15/clikpic/ndunridge/images";break}switch(a){case 25:b="http://tpc16/clikpic/ndunridge/images";break}switch(a){case 31:b="http://www7.clikpic.com/ndunridge/images";break}switch(a){case 32:b="http://admin2.clikpic.com/ndunridge/images";break}switch(a){case 33:b="http://www8.clikpic.com/ndunridge/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="Neil Dunridge Aviation 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;resizePhotoInfo({centre:true});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+"</p>";var e=c.purchase_instruction;var d=c.item_price;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(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+'")'})}}};