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[1410852]=new thumbnail(1410852,"","","self1_thumb.jpg",130,164,1);thumbnails[4164654]=new thumbnail(4164654,"","","I_Demand_Booze_thumb.jpg",130,87,1);thumbnails[6004824]=new thumbnail(6004824,"","","best_in_eden_thumb.JPG",130,89,1);thumbnails[6196523]=new thumbnail(6196523,"","","Portrait_thumb.jpg",130,94,1);thumbnails[3208706]=new thumbnail(3208706,"196075","Photography Monthly Feb2008","WEBMAG1_thumb.jpg",130,87,1);thumbnails[6352637]=new thumbnail(6352637,"351894","","Borrowdales4_thumb.jpg",130,195,1);thumbnails[6352642]=new thumbnail(6352642,"351894","","Borrowdales1_thumb.jpg",130,100,1);thumbnails[6352883]=new thumbnail(6352883,"351894","","ashgill_portrait_thumb.jpg",130,185,1);thumbnails[3213074]=new thumbnail(3213074,"196075","Black&White Photography July 2007","WEBMAG2_thumb.jpg",130,86,1);thumbnails[6352986]=new thumbnail(6352986,"351894","","Borrowdales2_thumb.jpg",130,87,1);thumbnails[3213077]=new thumbnail(3213077,"196075","Black&White Photography Sept 2003","WEBMAG3_thumb.jpg",130,94,1);thumbnails[800624]=new thumbnail(800624,"62123","Film Development","dev film2_thumb.jpg",130,173,1);thumbnails[800627]=new thumbnail(800627,"62123","Evaluate and Proofing","contact assessment_thumb.jpg",130,98,1);thumbnails[800630]=new thumbnail(800630,"62123","Test Print","test print_thumb.jpg",130,110,1);thumbnails[800646]=new thumbnail(800646,"62123","Dodging","dodging_thumb.jpg",130,84,1);thumbnails[800670]=new thumbnail(800670,"62123","Burning","burning_thumb.jpg",130,98,1);thumbnails[800686]=new thumbnail(800686,"62123","Print development","print dev 1_thumb.jpg",130,98,1);thumbnails[800692]=new thumbnail(800692,"62123","Bleaching","local bleach_thumb.jpg",130,160,1);thumbnails[800695]=new thumbnail(800695,"62123","Toning","toning_thumb.jpg",130,98,1);thumbnails[800700]=new thumbnail(800700,"62123","Print washing","washing_thumb.jpg",130,98,1);thumbnails[800759]=new thumbnail(800759,"62123","Drying","drying_thumb.jpg",130,98,1);thumbnails[800777]=new thumbnail(800777,"62123","FB Drying","FB drying_thumb.jpg",130,98,1);thumbnails[1281655]=new thumbnail(1281655,"62123","Finishing","Touch up_thumb.JPG",130,98,1);thumbnails[572908]=new thumbnail(572908,"44232","High Cup Nick","High-Cup-Nick12_thumb.jpg",130,98,1);thumbnails[572924]=new thumbnail(572924,"44232","Whitley Castle","WhitleyCastle_thumb.jpg",130,87,1);thumbnails[572928]=new thumbnail(572928,"44232","Death Row","Death-Row_thumb.jpg",130,130,1);thumbnails[572996]=new thumbnail(572996,"44232","Fox Tower","Fox-Tower_thumb.jpg",130,131,1);thumbnails[573003]=new thumbnail(573003,"44232","Helm Spirit","Helm-Spirit_thumb.jpg",130,89,1);thumbnails[573004]=new thumbnail(573004,"44232","Knock Quarry & Dufton Pike","Knock-Quarry+Dufton-Pike5_thumb.jpg",130,76,1);thumbnails[573009]=new thumbnail(573009,"44232","AshGill","Ashgill_thumb.jpg",130,185,1);thumbnails[1528364]=new thumbnail(1528364,"44232","Water Wheel","Water Wheel_thumb.jpg",130,128,1);thumbnails[3213108]=new thumbnail(3213108,"44232","Ashgill Force","AshgillForce_thumb.jpg",130,129,1);thumbnails[3805383]=new thumbnail(3805383,"44273","Eden Cut","star-trail_thumb.jpg",130,130,1);thumbnails[573522]=new thumbnail(573522,"44273","Nateby, Kirkby Stephen","Nateby-_thumb.jpg",130,116,1);thumbnails[1252921]=new thumbnail(1252921,"44273","Pendragon Castle","Pendragon_thumb.jpg",130,129,1);thumbnails[573420]=new thumbnail(573420,"44273","Stenkrith","Stenkrith_thumb.jpg",130,182,1);thumbnails[573610]=new thumbnail(573610,"44273","Birkdale Fleece","Birkdale-Fleece_thumb.jpg",130,92,1);thumbnails[3416608]=new thumbnail(3416608,"44273","Sunbiggin Tarn","Sunbiggin Tarn_thumb.jpg",130,128,1);thumbnails[581419]=new thumbnail(581419,"44273","Autumn Reflection","Autumn-Reflection_thumb.jpg",130,176,1);thumbnails[573634]=new thumbnail(573634,"44273","Wharton, Kirkby Stephen","Wharton_thumb.jpg",130,93,1);thumbnails[3720999]=new thumbnail(3720999,"44273","Uldale Mist","Uldale_Mist_thumb.jpg",130,128,1);thumbnails[573649]=new thumbnail(573649,"44273","Brough Castle","Brough-Castle_thumb.jpg",130,98,1);thumbnails[573669]=new thumbnail(573669,"44273","Lammerside Castle, Mallerstang","Lammerside_thumb.jpg",130,128,1);thumbnails[573714]=new thumbnail(573714,"44273","Hell Gill","Hell-Gill_thumb.jpg",130,133,1);thumbnails[573598]=new thumbnail(573598,"44273","Stonesdale Carriage","Stonesdale-Carriage_thumb.jpg",130,133,1);thumbnails[582156]=new thumbnail(582156,"44273","Belah Viaduct","Belah-Viaduct_thumb.jpg",130,138,1);thumbnails[582163]=new thumbnail(582163,"44273","Wild Boar","Wild-Boar_thumb.jpg",130,171,1);thumbnails[582166]=new thumbnail(582166,"44273","Elevation","Elevation3_thumb.jpg",130,176,1);thumbnails[595843]=new thumbnail(595843,"44273","Stonesdale Pen.","Stonesdale-Pen_thumb.jpg",130,129,1);thumbnails[728090]=new thumbnail(728090,"44273","Rain Burst,Orton","Rain-Burst-Orton_thumb.jpg",130,131,1);thumbnails[582169]=new thumbnail(582169,"44273","Orton Cross","OrtonCross1_thumb.jpg",130,132,1);thumbnails[1664882]=new thumbnail(1664882,"44273","Tanker","tanker_thumb.jpg",130,129,1);thumbnails[5592751]=new thumbnail(5592751,"44273","Aisgill Force","Aisgill_Force_thumb.jpg",130,129,1);thumbnails[568100]=new thumbnail(568100,"43781","Great Mell Fell                 ","Great-Mell- Fell12_thumb.jpg",130,193,1);thumbnails[568309]=new thumbnail(568309,"43781","Lost Travels, Mardale            ","Lost-Travels8_thumb.jpg",130,192,1);thumbnails[570310]=new thumbnail(570310,"43781","Sleddale Rise ","Sleddale-Rise_thumb.jpg",130,193,1);thumbnails[570418]=new thumbnail(570418,"43781","Catstye Cam","Catstye-Cam12_thumb.jpg",130,128,1);thumbnails[570558]=new thumbnail(570558,"43781","Crow Cragg","Crow-Cragg_thumb.jpg",130,93,1);thumbnails[570572]=new thumbnail(570572,"43781","Ullswater#1","Ullswater-1_thumb.jpg",130,84,1);thumbnails[571051]=new thumbnail(571051,"43781","Dodd Fell","Dodd-Fell_thumb.jpg",130,187,1);thumbnails[571089]=new thumbnail(571089,"43781","Mardale Gate","MardaleGate3_thumb.jpg",130,132,1);thumbnails[571616]=new thumbnail(571616,"43781","Fisherplace Gill","Fisherplace-Gill_thumb.jpg",130,141,1);thumbnails[571969]=new thumbnail(571969,"43781","Tewet Tarn","Tewet-Tarn_thumb.jpg",130,133,1);thumbnails[571983]=new thumbnail(571983,"43781","Angle Tarn","Angle-Tarn_thumb.jpg",130,136,1);thumbnails[572840]=new thumbnail(572840,"43781","Shap Express","Shap-Express_thumb.jpg",130,93,1);thumbnails[1252841]=new thumbnail(1252841,"43781","Pillar, Cathedral Quarry","Pillar3_thumb.jpg",130,129,1);thumbnails[1442823]=new thumbnail(1442823,"43781","Newlands Curiosity","NewlandsCuriosity3_thumb.jpg",130,129,1);thumbnails[1795134]=new thumbnail(1795134,"43781","Brothers Water","Brothers-Water_thumb.jpg",130,126,1);thumbnails[2550721]=new thumbnail(2550721,"43781","Illuminated Rain, Keswick","Illuminated_Rain_Web_thumb.jpg",130,115,1);thumbnails[2823409]=new thumbnail(2823409,"43781","Swirral Edge","SwirralEdge_thumb.jpg",130,131,1);thumbnails[3345424]=new thumbnail(3345424,"43781","Dobgill, Thirlmere","DobgillThirlmere_thumb.jpg",130,130,1);thumbnails[3684089]=new thumbnail(3684089,"43781","Mosedale Cottage","Mosedale_Cottage_thumb.jpg",130,131,1);thumbnails[3988729]=new thumbnail(3988729,"43781","Scalehow Force","Scalehow_Force1_thumb.jpg",130,131,1);thumbnails[5591677]=new thumbnail(5591677,"43781","Grisedale Pike","Grisedale_Pike_thumb.jpg",130,132,1);thumbnails[5684095]=new thumbnail(5684095,"43781","Aira Point","Aira_Point1_thumb.jpg",130,129,1);thumbnails[4829922]=new thumbnail(4829922,"275853","Dufton Show#1","Dufton_Show_Web1_thumb.jpg",130,129,1);thumbnails[4829926]=new thumbnail(4829926,"275853","Dufton Show Tractor Race","Dufton_Show_Web2_thumb.jpg",130,131,1);thumbnails[4829930]=new thumbnail(4829930,"275853","Abandoned Sit","Dufton_Show_Web3_thumb.jpg",130,131,1);thumbnails[4829935]=new thumbnail(4829935,"275853","Dancing Scarecrow","Scare_Crow_Web1_thumb.jpg",130,129,1);thumbnails[5630095]=new thumbnail(5630095,"275853","Glenridding Beck Moon Trail","Glenridding_Beck_Moon_Trail_thumb.jpg",130,131,1);thumbnails[6355079]=new thumbnail(6355079,"275853","TV Remote","TV_Remote1_thumb.jpg",130,130,1);var galleries=new Object();galleries[351894]=new gallery(351894,"6352986,6352883,6352642,6352637","Landscape Portraiture","section419892",[6352637,6352642,6352883,6352986]);galleries[196075]=new gallery(196075,"3213077,3213074,3208706","PUBLICATIONS","section241651",[3208706,3213074,3213077]);galleries[62123]=new gallery(62123,"1281655,800777,800759,800700,800695,800692,800686,800670,800646,800630","Technique","section90249",[800624,800627,800630,800646,800670,800686,800692,800695,800700,800759,800777,1281655]);galleries[44232]=new gallery(44232,"572908","East","gallery",[572908,572924,572928,572996,573003,573004,573009,1528364,3213108]);galleries[44273]=new gallery(44273,"573522","South","gallery",[3805383,573522,1252921,573420,573610,3416608,581419,573634,3720999,573649,573669,573714,573598,582156,582163,582166,595843,728090,582169,1664882,5592751]);galleries[43781]=new gallery(43781,"568100","West","gallery",[568100,568309,570310,570418,570558,570572,571051,571089,571616,571969,571983,572840,1252841,1442823,1795134,2550721,2823409,3345424,3684089,3988729,5591677,5684095]);galleries[275853]=new gallery(275853,"4829922","Cumbria Quirk","gallery",[4829922,4829926,4829930,4829935,5630095,6355079]);var imageSets=new Object();imageSets[236522]="6352986,6352883,6352642,6352637";imageSets[1]="3805383";imageSets[2]="4829922,573522,572908,568100";imageSets[3]="6355079,6352986,6352883,6352642,6352637,6196523,6004824,5684095,5630095,5592751,5591677,4829935,4829930,4829926,4829922,4164654,3988729,3805383,3720999,3684089,3416608,3345424,3213108,3213077,3213074,3208706,2823409,2550721,1795134,1664882,1528364,1442823,1410852,1281655,1252921,1252841,800777,800759,800700,800695,800692,800686,800670,800646,800630,800627,800624,728090,595843,582169";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/royflem/images";break}switch(a){case 1:b="http://www1.clikpic.com/royflem/images";break}switch(a){case 2:b="http://admin.clikpic.com/royflem/images";break}switch(a){case 24:b="http://tpc15/clikpic/royflem/images";break}switch(a){case 4:b="http://www.clikchurch.com/royflem/images";break}switch(a){case 5:b="http://www2.clikpic.com/royflem/images";break}switch(a){case 22:b="http://tpc5/clikpic/royflem/images";break}switch(a){case 23:b="http://tpc10/clikpic/royflem/images";break}switch(a){case 25:b="http://tpc16/clikpic/royflem/images";break}switch(a){case 15:b="http://www3.clikpic.com/royflem/images";break}switch(a){case 18:b="http://www4.clikpic.com/royflem/images";break}switch(a){case 19:b="http://www5.clikpic.com/royflem/images";break}switch(a){case 31:b="http://www7.clikpic.com/royflem/images";break}switch(a){case 32:b="http://admin2.clikpic.com/royflem/images";break}switch(a){case 33:b="http://www8.clikpic.com/royflem/images";break}switch(a){case 34:b="http://www9.clikpic.com/royflem/images";break}switch(a){case 35:b="http://admin3.clikpic.com/royflem/images";break}switch(a){case 37:b="http://admin4.clikpic.com/royflem/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="Roy Fleming Photographic: "+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+'")'})}}};