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[5688289]=new thumbnail(5688289,"322183","","_MG_3744_bw1_thumb.jpg",130,80,18);thumbnails[5788556]=new thumbnail(5788556,"322183","","_MG_3981web1_thumb.jpg",130,91,18);thumbnails[5794390]=new thumbnail(5794390,"322183","","_MG_3636web_thumb.jpg",130,75,18);thumbnails[5794393]=new thumbnail(5794393,"322183","","_MG_3974web_thumb.jpg",130,76,18);thumbnails[5794398]=new thumbnail(5794398,"322183","","IMG_3030web_thumb.jpg",130,70,18);thumbnails[5794399]=new thumbnail(5794399,"322183","","DSCF1241web_thumb.jpg",130,78,18);thumbnails[5794425]=new thumbnail(5794425,"322183","","IMG_2678web_thumb.jpg",130,58,18);thumbnails[5794431]=new thumbnail(5794431,"322183","","DPP_0001_2_thumb.JPG",130,86,18);thumbnails[5794432]=new thumbnail(5794432,"322183","","DPP_0004_thumb.JPG",130,79,18);thumbnails[5794435]=new thumbnail(5794435,"322183","","IMG_0280copy_thumb.jpg",130,81,18);thumbnails[5794436]=new thumbnail(5794436,"322183","","IMG_8686_thumb.JPG",130,77,18);thumbnails[5805396]=new thumbnail(5805396,"328107","","Bigbury1_thumb.jpg",130,72,18);thumbnails[5805399]=new thumbnail(5805399,"328107","","Brentor_Church1_thumb.jpg",130,87,18);thumbnails[5805401]=new thumbnail(5805401,"328107","","Dartmeet1_-_Copy_thumb.jpg",130,64,18);thumbnails[5805402]=new thumbnail(5805402,"328107","","Giants_Chair1_-_Copy_thumb.jpg",130,79,18);thumbnails[5805403]=new thumbnail(5805403,"328107","","Nuns_Cross_farm1_thumb.jpg",130,68,18);thumbnails[5805405]=new thumbnail(5805405,"328107","","Rame_Head_Dec_09_thumb.jpg",130,82,18);thumbnails[5805408]=new thumbnail(5805408,"328107","","Remains_Of_Auntumn_thumb.jpg",130,76,18);thumbnails[5805415]=new thumbnail(5805415,"328107","","sun_set_West_hoe_Mount_Edg_and_Drakes_Island_Nov_09_thumb.jpg",130,54,18);thumbnails[5805419]=new thumbnail(5805419,"328107","","151009n_11005web_thumb.jpg",130,78,18);thumbnails[5818797]=new thumbnail(5818797,"329361","","Mount_batten_pier_web_thumb.jpg",130,68,18);thumbnails[5818798]=new thumbnail(5818798,"329361","","Lighthouse_web_thumb.jpg",130,87,18);thumbnails[5818799]=new thumbnail(5818799,"329361","","Rock_web_thumb.jpg",130,76,18);thumbnails[5818800]=new thumbnail(5818800,"329361","","Two_bridges2_web_thumb.jpg",130,87,18);thumbnails[5818801]=new thumbnail(5818801,"329361","","St_Michaels_web_thumb.jpg",130,78,18);thumbnails[5818804]=new thumbnail(5818804,"329361","","Under_pier_web_thumb.jpg",130,77,18);thumbnails[5818805]=new thumbnail(5818805,"329361","","Riverweb_thumb.jpg",130,84,18);thumbnails[5818808]=new thumbnail(5818808,"329361","","IMG_2175_9_8_tonemapped_web_thumb.jpg",130,94,18);thumbnails[5818809]=new thumbnail(5818809,"329361","","Sharrow_sunset_2_web_thumb.jpg",130,81,18);thumbnails[5818810]=new thumbnail(5818810,"329361","","Diving_board_2_web_thumb.jpg",130,74,18);thumbnails[5836541]=new thumbnail(5836541,"322183","","_MG_4153web_thumb.jpg",130,72,18);thumbnails[5836542]=new thumbnail(5836542,"322183","","_MG_4129web_thumb.jpg",130,80,18);thumbnails[5836548]=new thumbnail(5836548,"330253","","Back_in_time_at_widecombe_in_the_moor_web_thumb.jpg",130,83,18);thumbnails[5836550]=new thumbnail(5836550,"330253","","From_the_river_bank_web_thumb.jpg",130,95,18);thumbnails[5836551]=new thumbnail(5836551,"330253","","In_a_golden_bay_web_thumb.jpg",130,55,18);thumbnails[5836553]=new thumbnail(5836553,"330253","","Sun_down_at_Bigbury_Bay_web_thumb.jpg",130,62,18);thumbnails[5836554]=new thumbnail(5836554,"330253","","The_moors_at_dusk_web_thumb.jpg",130,86,18);thumbnails[5836562]=new thumbnail(5836562,"330253","","Plymouth_Hoe_a3_mount_frame_web_thumb.jpg",130,61,18);thumbnails[5844468]=new thumbnail(5844468,"322183","","_MG_4008web_thumb.jpg",130,75,18);thumbnails[5844476]=new thumbnail(5844476,"322183","","_MG_4229web1_thumb.jpg",130,78,18);thumbnails[5904611]=new thumbnail(5904611,"333239","","DSC_0321web_thumb.jpg",130,86,18);thumbnails[5904612]=new thumbnail(5904612,"333239","","DSC_0651web_thumb.jpg",130,86,18);thumbnails[5904613]=new thumbnail(5904613,"333239","","DSC_0660web_thumb.jpg",130,87,18);thumbnails[5904614]=new thumbnail(5904614,"333239","","DSC_0994web_thumb.jpg",130,91,18);thumbnails[5904617]=new thumbnail(5904617,"333239","","DSC_2217web_thumb.jpg",130,86,18);thumbnails[5904623]=new thumbnail(5904623,"333239","","DSC_0863web_thumb.jpg",130,98,18);thumbnails[5915244]=new thumbnail(5915244,"330253","","dartmeet_wier_thumb.jpg",130,51,18);thumbnails[5915245]=new thumbnail(5915245,"330253","","Pebbles_thumb.jpg",130,56,18);thumbnails[5915247]=new thumbnail(5915247,"330253","","charlestown_harbour_thumb.jpg",130,157,18);thumbnails[5915250]=new thumbnail(5915250,"330253","","The_lights_Burgh_Island_web_thumb.jpg",130,78,18);thumbnails[5991252]=new thumbnail(5991252,"322183","","_MG_4515web_thumb.jpg",130,85,18);thumbnails[5991254]=new thumbnail(5991254,"322183","","_MG_4517web_thumb.jpg",130,167,18);thumbnails[5991257]=new thumbnail(5991257,"322183","","_MG_4686web_thumb.jpg",130,80,18);thumbnails[5991258]=new thumbnail(5991258,"322183","","_MG_4697web_thumb.jpg",130,83,18);thumbnails[5991259]=new thumbnail(5991259,"322183","","_MG_4670web_thumb.jpg",130,195,18);thumbnails[6318982]=new thumbnail(6318982,"322183","","102_0082_web_thumb.jpg",130,34,18);thumbnails[6318983]=new thumbnail(6318983,"322183","","100_0124web_thumb.jpg",130,34,18);thumbnails[6318984]=new thumbnail(6318984,"322183","","100_0132web_thumb.jpg",130,34,18);thumbnails[6318988]=new thumbnail(6318988,"322183","","100_0136web_thumb.jpg",130,34,18);thumbnails[6000372]=new thumbnail(6000372,"322181","kodak c142","102_0098_thumb.JPG",130,98,18);thumbnails[6000377]=new thumbnail(6000377,"322181","kodak c190","102_0097_thumb.JPG",130,98,18);thumbnails[6000384]=new thumbnail(6000384,"322181","kodak m341","102_0099_thumb.JPG",130,98,18);thumbnails[6000387]=new thumbnail(6000387,"322181","casio ex-z330","102_0095_thumb.JPG",130,98,18);thumbnails[6000390]=new thumbnail(6000390,"322181","casio ex-z550","102_0096_thumb.JPG",130,96,18);thumbnails[6000348]=new thumbnail(6000348,"322181","meade 80 mm refractor","102_0091_thumb.JPG",130,65,18);thumbnails[6000363]=new thumbnail(6000363,"322181","meade 70 mm refractor","102_0092_thumb.JPG",130,52,18);thumbnails[6000367]=new thumbnail(6000367,"322181","meade 114mm reflector","102_0093_thumb.JPG",130,54,18);thumbnails[6000446]=new thumbnail(6000446,"322181","astro box set","100_0101_thumb.JPG",130,105,18);thumbnails[6000450]=new thumbnail(6000450,"322181","filters","100_0102_thumb.JPG",130,98,18);thumbnails[5805423]=new thumbnail(5805423,"328107","","Hoe_thumb.jpg",130,194,18);var galleries=new Object();galleries[322183]=new gallery(322183,"6318988,6318984,6318983,6318982,5991259,5991258,5991257,5991254,5991252,5844476","dave fry","section386548",[5688289,5788556,5794390,5794393,5794398,5794399,5794425,5794431,5794432,5794435,5794436,5836541,5836542,5844468,5844476,5991252,5991254,5991257,5991258,5991259,6318982,6318983,6318984,6318988]);galleries[333239]=new gallery(333239,"5904623,5904617,5904614,5904613,5904612,5904611","dave scholey","section399283",[5904611,5904612,5904613,5904614,5904617,5904623]);galleries[329361]=new gallery(329361,"5818810,5818809,5818808,5818805,5818804,5818801,5818800,5818799,5818798,5818797","gary king","section394621",[5818797,5818798,5818799,5818800,5818801,5818804,5818805,5818808,5818809,5818810]);galleries[328107]=new gallery(328107,"5805423,5805419,5805415,5805408,5805405,5805403,5805402,5805401,5805399,5805396","ian watson","section393236",[5805396,5805399,5805401,5805402,5805403,5805405,5805408,5805415,5805419,5805423]);galleries[330253]=new gallery(330253,"5915250,5915247,5915245,5915244,5836562,5836554,5836553,5836551,5836550,5836548","mark tremain","section395777",[5836548,5836550,5836551,5836553,5836554,5836562,5915244,5915245,5915247,5915250]);galleries[322181]=new gallery(322181,"6000450,6000446,6000390,6000387,6000384,6000377,6000372,6000367,6000363,6000348","shop","section386545",[6000372,6000377,6000384,6000387,6000390,6000348,6000363,6000367,6000446,6000450]);var imageSets=new Object();imageSets[1]="6318988,6318984,6318983,6318982,6000450,6000446,6000390,6000387,6000384,6000377,6000372,6000367,6000363,6000348,5991259,5991258,5991257,5991254,5991252,5915250,5915247,5915245,5915244,5904623,5904617,5904614,5904613,5904612,5904611,5844476,5844468,5836562,5836554,5836553,5836551,5836550,5836548,5836542,5836541,5818810,5818809,5818808,5818805,5818804,5818801,5818800,5818799,5818798,5818797,5805423";imageSets[3]="6318988,6318984,6318983,6318982,6000450,6000446,6000390,6000387,6000384,6000377,6000372,6000367,6000363,6000348,5991259,5991258,5991257,5991254,5991252,5915250,5915247,5915245,5915244,5904623,5904617,5904614,5904613,5904612,5904611,5844476,5844468,5836562,5836554,5836553,5836551,5836550,5836548,5836542,5836541,5818810,5818809,5818808,5818805,5818804,5818801,5818800,5818799,5818798,5818797,5805423";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/davefry/images";break}switch(a){case 1:b="http://www1.clikpic.com/davefry/images";break}switch(a){case 2:b="http://admin.clikpic.com/davefry/images";break}switch(a){case 24:b="http://tpc15/clikpic/davefry/images";break}switch(a){case 4:b="http://www.clikchurch.com/davefry/images";break}switch(a){case 5:b="http://www2.clikpic.com/davefry/images";break}switch(a){case 22:b="http://tpc5/clikpic/davefry/images";break}switch(a){case 23:b="http://tpc10/clikpic/davefry/images";break}switch(a){case 25:b="http://tpc16/clikpic/davefry/images";break}switch(a){case 15:b="http://www3.clikpic.com/davefry/images";break}switch(a){case 18:b="http://www4.clikpic.com/davefry/images";break}switch(a){case 19:b="http://www5.clikpic.com/davefry/images";break}switch(a){case 31:b="http://www7.clikpic.com/davefry/images";break}switch(a){case 32:b="http://admin2.clikpic.com/davefry/images";break}switch(a){case 33:b="http://www8.clikpic.com/davefry/images";break}switch(a){case 34:b="http://www9.clikpic.com/davefry/images";break}switch(a){case 35:b="http://admin3.clikpic.com/davefry/images";break}switch(a){case 37:b="http://admin4.clikpic.com/davefry/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("section386545"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section386545.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("section386545"!=""){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="south west views: "+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>"}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 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+'<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="dfryphotography@aol.com">';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="dfryphotography@aol.com">';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+'")'})}}};