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[3245588]=new thumbnail(3245588,"73706","Fountains Abbey reflection","Fountains Abbey reflection_thumb.jpg",130,172,18);thumbnails[1917873]=new thumbnail(1917873,"73706","Ana Cross","Ana Cross  _thumb.jpg",130,92,18);thumbnails[1917883]=new thumbnail(1917883,"73706","Rosedale mine ruins","Rosedale mine ruins_thumb.jpg",130,78,18);thumbnails[1917895]=new thumbnail(1917895,"73706","The old railway track, Rosedale","Rosedale Railway_thumb.jpg",130,94,18);thumbnails[3245604]=new thumbnail(3245604,"73706","Mount Grace Priory","Mount Grace Priory_thumb.jpg",130,182,18);thumbnails[3245577]=new thumbnail(3245577,"73706","Ruined cottage","Ruined cottage_thumb.jpg",130,93,18);thumbnails[981570]=new thumbnail(981570,"73709","Aira Force","Aira_Force_thumb.jpg",130,93,18);thumbnails[981573]=new thumbnail(981573,"73709","Castle Rigg","Castle_Rigg_thumb.jpg",130,75,18);thumbnails[981576]=new thumbnail(981576,"73709","Martindale","Martindale_thumb.jpg",130,83,18);thumbnails[981578]=new thumbnail(981578,"73709","Ullswater boathouse","Ullswater_boathouse_thumb.jpg",130,166,18);thumbnails[981584]=new thumbnail(981584,"73710","The Harbour","Whitby_harbour_thumb.jpg",130,132,18);thumbnails[981585]=new thumbnail(981585,"73710","The Minster","York_Minster_thumb.jpg",130,158,18);thumbnails[981588]=new thumbnail(981588,"73710","The Shambles","YorkThe_Shambles_thumb.jpg",130,132,18);thumbnails[981590]=new thumbnail(981590,"73710","Blackburn's Yard","Blackburns_yard_-_Whitby_thumb.jpg",130,137,18);thumbnails[981597]=new thumbnail(981597,"73710","Christmas House","Christmas__House_-_Richmond_thumb.jpg",130,96,18);thumbnails[981599]=new thumbnail(981599,"73710","Millgate","MillgateRichmond_thumb.jpg",130,174,18);thumbnails[981601]=new thumbnail(981601,"73710","The Barr","The_Bar_Richmond_thumb.jpg",130,175,18);thumbnails[981602]=new thumbnail(981602,"73710","Baker's Alley","Thirsk_Bakers_Alley_thumb.jpg",130,139,18);thumbnails[981604]=new thumbnail(981604,"73710","Finkle Street","Thirsk_Finkle_Street_thumb.jpg",130,119,18);thumbnails[981606]=new thumbnail(981606,"73710","Alleyway","Whitby__Alleyway_thumb.jpg",130,134,18);thumbnails[981610]=new thumbnail(981610,"73711","Evening low tide","Balekeney_thumb.jpg",130,216,18);thumbnails[981611]=new thumbnail(981611,"73711","Low tide","Burnham_Overy_Staithe_thumb.jpg",130,94,18);thumbnails[981613]=new thumbnail(981613,"73711","Cley Mill 1","Cley_mill_thumb.jpg",130,180,18);thumbnails[981621]=new thumbnail(981621,"73711","Cley Mill 2","Cley_windmill_11234_thumb.jpg",130,176,18);thumbnails[981629]=new thumbnail(981629,"73711","High and dry","Past_its_bestBlakeney_thumb.jpg",130,96,18);thumbnails[981637]=new thumbnail(981637,"73708","Late Spring snow","Beinn_Eighe_in_snow_thumb.jpg",130,92,18);thumbnails[981639]=new thumbnail(981639,"73708","Towards Flowerdale","Flowerdale_thumb.jpg",130,96,18);thumbnails[981640]=new thumbnail(981640,"73708","Down the glen","Glen_Torridon_thumb.jpg",130,95,18);thumbnails[981647]=new thumbnail(981647,"73708","Beinn Eighe","Scotland_Beinn_Eighe_-_trees_thumb.jpg",130,98,18);thumbnails[981648]=new thumbnail(981648,"73708","Storm on the loch","Storm_on_Loch_Torridon_thumb.jpg",130,96,18);thumbnails[981650]=new thumbnail(981650,"73706","Walled garden","Helmsley_Walled_Garden_thumb.jpg",130,183,18);thumbnails[981685]=new thumbnail(981685,"73706","Rievaulx Abbey","Rievaulx_Abbey_thumb.jpg",130,179,18);thumbnails[981687]=new thumbnail(981687,"73706","Staithes","Staithes_1_thumb.jpg",130,117,18);thumbnails[981689]=new thumbnail(981689,"73706","Gate in the snow","Sutton_Bank_gate_in_snow_thumb.jpg",130,118,18);thumbnails[981693]=new thumbnail(981693,"73706","Whitby harbour 1","Whitby_1_thumb.jpg",130,96,18);thumbnails[981695]=new thumbnail(981695,"73706","Bridge at Sowerby","Bridge_at_Sowerby_thumb.jpg",130,160,18);thumbnails[981697]=new thumbnail(981697,"73706","Garbutt Wood","Garbutt_Wood_thumb.jpg",130,82,18);thumbnails[981698]=new thumbnail(981698,"73706","Weathered groynes","Groynes_-_Sandsensd_thumb.jpg",130,183,18);thumbnails[981700]=new thumbnail(981700,"73706","Castle from the walled garden","Helmsley_Castle_bw_thumb.jpg",130,93,18);thumbnails[981704]=new thumbnail(981704,"73706","Lighthouse","Lighthouse_-_Whitby_thumb.jpg",130,223,18);thumbnails[981709]=new thumbnail(981709,"73706","Nunnington Hall","Nunnington_Hall_thumb.jpg",130,88,18);thumbnails[981713]=new thumbnail(981713,"73706","On Rievaulx Moor","On_Rievaulx_Moor_thumb.jpg",130,95,18);thumbnails[981715]=new thumbnail(981715,"73706","The nave","Ripon_Cathedral_nave_thumb.jpg",130,83,18);thumbnails[981718]=new thumbnail(981718,"73706","Cottage on the sea wall","Runswick_Bay_thumb.jpg",130,92,18);thumbnails[981722]=new thumbnail(981722,"73706","Staithes Cobles","Staithes_cobles_thumb.jpg",130,85,18);thumbnails[981723]=new thumbnail(981723,"73706","Gate,Cleveland Way","Sutton_Bank_gate_thumb.jpg",130,76,18);thumbnails[981725]=new thumbnail(981725,"73706","Whitby Harbour 2","Whitby_2_thumb.jpg",130,181,18);thumbnails[981727]=new thumbnail(981727,"73706","Whitby Harbour 3","Whitby_3_thumb.jpg",130,91,18);thumbnails[995767]=new thumbnail(995767,"73708","Slioch","Slioch_thumb.jpg",130,95,18);thumbnails[995775]=new thumbnail(995775,"73708","Boats at Diabaig","Diabeg_boats_tif_thumb.jpg",130,147,18);thumbnails[995780]=new thumbnail(995780,"73706","Winter sunshine","Studley_Royal_thumb.jpg",130,93,18);thumbnails[1279782]=new thumbnail(1279782,"73708","Castle Stalker","Castle-Stalker_thumb.gif",130,86,18);thumbnails[1279797]=new thumbnail(1279797,"73708","Gylen Castle","Gylen-Castle_thumb.gif",130,86,18);thumbnails[1279802]=new thumbnail(1279802,"73708","Gylen Castle and Mull","Gylen-Castle-and-Mull_thumb.gif",130,87,18);thumbnails[1279823]=new thumbnail(1279823,"73709","Buttermere","Tree-by-Buttermere_thumb.gif",130,110,18);thumbnails[1917871]=new thumbnail(1917871,"","","Rievaulx Abbey 2",130,86,2);thumbnails[3772441]=new thumbnail(3772441,"73706","Snow at Sneck Yat","Snow_at_Sneck_Yat1_thumb.jpg",130,92,18);thumbnails[3772475]=new thumbnail(3772475,"73706","Surrender Smelt Mill","Surrender_Smelt_Mill_1_thumb.jpg",130,89,18);thumbnails[3772480]=new thumbnail(3772480,"73706","Windswept trees on the top os Sutton Bank","Trees_on_Sutton_Bank123_thumb.jpg",130,91,18);thumbnails[3772523]=new thumbnail(3772523,"73709","Easedale","Easedale2_thumb.jpg",130,95,18);thumbnails[3772843]=new thumbnail(3772843,"73709","Rowan's Ground, Grasmere","Rowans_Ground_Grasmere1_thumb.jpg",130,86,18);thumbnails[4212340]=new thumbnail(4212340,"73706","Treeline in the snow","Tree_line_-_Sutton_Bank1234_thumb.jpg",130,73,18);thumbnails[6633380]=new thumbnail(6633380,"73706","East Pier, Whitby","Harbour_mouth_resize_thumb.jpg",130,92,18);thumbnails[6633384]=new thumbnail(6633384,"73706","Hutton le Hole","Hutton_le_Hole_resize_thumb.jpg",130,91,18);thumbnails[6633386]=new thumbnail(6633386,"73706","Woodland path by Lake Gormire","Path_Gormire_resize_thumb.jpg",130,186,18);thumbnails[6633390]=new thumbnail(6633390,"73706","A temple on Rievaulx Terraces","RievaulxTemple_resize_thumb.jpg",130,183,18);thumbnails[6633422]=new thumbnail(6633422,"73706","Path to Thirkleby","Thirkleby_path_resize_thumb.jpg",130,100,18);thumbnails[6633425]=new thumbnail(6633425,"73706","Whitestone Cliffe","Whitestone_Cliff_bw_resize_thumb.jpg",130,167,18);thumbnails[6633679]=new thumbnail(6633679,"73709","Lake Buttermere","Buttermere_fence_sepia_resize_thumb.jpg",130,99,18);thumbnails[6633687]=new thumbnail(6633687,"73709","Ruin near High Street","High_Street_ruin_resize_thumb.jpg",130,91,18);thumbnails[6634059]=new thumbnail(6634059,"363266","Stream, Aira Force","Aira_resize_thumb.JPG",130,91,18);thumbnails[6634064]=new thumbnail(6634064,"363266","Beach huts at Whitby","Beach_huts_resize_thumb.jpg",130,89,18);thumbnails[6634141]=new thumbnail(6634141,"363266","Crowning glory","Crowning_glory_2_resize_thumb.jpg",130,186,18);thumbnails[6634158]=new thumbnail(6634158,"363266","Golden light","Golden_light_resize_thumb.jpg",130,89,18);thumbnails[6634170]=new thumbnail(6634170,"363266","Swan with cygnet","DSC_5074_resize_thumb.jpg",130,98,18);thumbnails[6634178]=new thumbnail(6634178,"363266","Sir Lamiel","Sir_Lamiel_3JPEG-01_resize_thumb.jpg",130,74,18);thumbnails[6634185]=new thumbnail(6634185,"363266","Sir Nigel Gresley","Sir_N_Gresley_resize_thumb.jpg",130,91,18);thumbnails[6634189]=new thumbnail(6634189,"363266","Tornado","Tornado_Pickering_resize_thumb.jpg",130,96,18);thumbnails[6634203]=new thumbnail(6634203,"363266","Tornado 1st Day","Tornado_resize_thumb.jpg",130,85,18);var galleries=new Object();galleries[363266]=new gallery(363266,"6634203,6634189,6634185,6634178,6634170,6634158,6634141,6634064,6634059","Colour and other","gallery",[6634059,6634064,6634141,6634158,6634170,6634178,6634185,6634189,6634203]);galleries[73709]=new gallery(73709,"981578","Lake District","gallery",[981570,981573,981576,981578,1279823,3772523,3772843,6633679,6633687]);galleries[73710]=new gallery(73710,"981590","Night shots","gallery",[981584,981585,981588,981590,981597,981599,981601,981602,981604,981606]);galleries[73711]=new gallery(73711,"981613","Norfolk","gallery",[981610,981611,981613,981621,981629]);galleries[73706]=new gallery(73706,"981713","North Yorkshire","gallery",[3245588,1917873,1917883,1917895,3245604,3245577,981650,981685,981687,981689,981693,981695,981697,981698,981700,981704,981709,981713,981715,981718,981722,981723,981725,981727,995780,3772441,3772475,3772480,4212340,6633380,6633384,6633386,6633390,6633422,6633425]);galleries[73708]=new gallery(73708,"981647","Scotland","gallery",[981637,981639,981640,981647,981648,995767,995775,1279782,1279797,1279802]);var imageSets=new Object();imageSets[1]="981713,981647";imageSets[2]="981713,981647,981613,981590,981578";imageSets[3]="6634203,6634189,6634185,6634178,6634170,6634158,6634141,6634064,6634059,6633687,6633679,6633425,6633422,6633390,6633386,6633384,6633380,4212340,3772843,3772523,3772480,3772475,3772441,3245604,3245588,3245577,1917895,1917883,1917873,1917871,1279823,1279802,1279797,1279782,995780,995775,995767,981727,981725,981723,981722,981718,981715,981713,981709,981704,981700,981698,981697,981695";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/donnesham/images";break}switch(a){case 1:b="http://www1.clikpic.com/donnesham/images";break}switch(a){case 2:b="http://admin.clikpic.com/donnesham/images";break}switch(a){case 24:b="http://tpc15/clikpic/donnesham/images";break}switch(a){case 4:b="http://www.clikchurch.com/donnesham/images";break}switch(a){case 5:b="http://www2.clikpic.com/donnesham/images";break}switch(a){case 22:b="http://tpc5/clikpic/donnesham/images";break}switch(a){case 23:b="http://tpc10/clikpic/donnesham/images";break}switch(a){case 25:b="http://tpc16/clikpic/donnesham/images";break}switch(a){case 15:b="http://www3.clikpic.com/donnesham/images";break}switch(a){case 18:b="http://www4.clikpic.com/donnesham/images";break}switch(a){case 19:b="http://www5.clikpic.com/donnesham/images";break}switch(a){case 31:b="http://www7.clikpic.com/donnesham/images";break}switch(a){case 32:b="http://admin2.clikpic.com/donnesham/images";break}switch(a){case 33:b="http://www8.clikpic.com/donnesham/images";break}switch(a){case 34:b="http://www9.clikpic.com/donnesham/images";break}switch(a){case 35:b="http://admin3.clikpic.com/donnesham/images";break}switch(a){case 37:b="http://admin4.clikpic.com/donnesham/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="Donald Nesham Creative Images: "+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+'")'})}}};