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[661776]=new thumbnail(661776,"50239","Polperro outer harbour","IMG_1431_thumb.jpg",120,80,18);thumbnails[661779]=new thumbnail(661779,"50239","Dawn at Chapel","IMG_7851_thumb.jpg",120,80,18);thumbnails[661781]=new thumbnail(661781,"50239","Autumn reflections","IMG_7565_thumb.jpg",120,80,18);thumbnails[661782]=new thumbnail(661782,"50239","Dawn at Lantivet","IMG_8013_thumb.jpg",120,80,18);thumbnails[661784]=new thumbnail(661784,"50239","Early Spring on the road to Talland Bay","IMG_2571_thumb.jpg",120,79,18);thumbnails[661785]=new thumbnail(661785,"50239","Father and son","IMG_6450_thumb.jpg",120,80,18);thumbnails[661786]=new thumbnail(661786,"50239","Lantivet morning","IMG_8077_thumb.jpg",120,80,18);thumbnails[661788]=new thumbnail(661788,"50239","Talland sunrise","IMG_8127_thumb.jpg",120,80,18);thumbnails[661789]=new thumbnail(661789,"50239","Bluebells","IMG_3805_thumb.jpg",120,80,18);thumbnails[661817]=new thumbnail(661817,"50239","Approaching Polperro harbour","IMG_0531_thumb.jpg",120,80,18);thumbnails[661819]=new thumbnail(661819,"50239","Chapel Pool morning","IMG_77672_thumb.jpg",120,80,18);thumbnails[661820]=new thumbnail(661820,"50239","Lake Rock dawn","IMG_7379_thumb.jpg",120,80,18);thumbnails[661793]=new thumbnail(661793,"50245","Port Nadler morning","IMG_8190_thumb.jpg",120,80,18);thumbnails[661794]=new thumbnail(661794,"50245","Whitsand Bay","IMG_8588_thumb.jpg",120,80,18);thumbnails[661795]=new thumbnail(661795,"50245","Fowey reflections","IMG_4934_thumb.jpg",120,80,18);thumbnails[661796]=new thumbnail(661796,"50245","Chapel Point, Portmellon","IMG_5694_thumb.jpg",120,80,18);thumbnails[661821]=new thumbnail(661821,"50245","Stone wall and sea","IMG_0644_thumb.jpg",120,77,18);thumbnails[661822]=new thumbnail(661822,"50245","Lake Rock sunrise","IMG_8659_thumb.jpg",120,80,18);thumbnails[661823]=new thumbnail(661823,"50245","River Lynher reflections","IMG_6177_thumb.jpg",120,80,18);thumbnails[661824]=new thumbnail(661824,"50245","Straw, sheep and clouds","IMG_6077_thumb.jpg",120,80,18);thumbnails[661825]=new thumbnail(661825,"50245","Cave and cove","IMG_8836_thumb.jpg",120,80,18);thumbnails[661826]=new thumbnail(661826,"50245","Polperro trees and boat","IMG_3875_thumb.jpg",120,84,18);thumbnails[661827]=new thumbnail(661827,"50245","Sailing boat outside Polperro","IMG_9454_thumb.jpg",120,80,18);thumbnails[661829]=new thumbnail(661829,"50245","Pebble beach","IMG_07841_thumb.jpg",120,80,18);thumbnails[661790]=new thumbnail(661790,"50241","Treverbyn Bridge","IMG_9955_thumb.jpg",120,80,18);thumbnails[661791]=new thumbnail(661791,"50241","Valency valley","IMG_8983_thumb.jpg",120,80,18);thumbnails[661792]=new thumbnail(661792,"50241","Chapel sea pinks","IMG_9975_thumb.jpg",120,180,18);thumbnails[661797]=new thumbnail(661797,"50241","Sea pinks","IMG_3758_thumb.jpg",120,80,18);thumbnails[661798]=new thumbnail(661798,"50241","Pencarrow Head","IMG_5116_thumb.jpg",120,80,18);thumbnails[661799]=new thumbnail(661799,"50241","Poppies in a hay field","IMG_4480_thumb.jpg",120,80,18);thumbnails[661800]=new thumbnail(661800,"50241","Luxulyan valley","IMG10747_thumb.jpg",120,180,18);thumbnails[661804]=new thumbnail(661804,"50241","Pentewan","IMG_8871_thumb.jpg",120,80,18);thumbnails[661805]=new thumbnail(661805,"50241","West Looe boats","IMG_0435_thumb.jpg",120,80,18);thumbnails[661809]=new thumbnail(661809,"50241","Sunrise, from Lake Rock","IMG_7399_thumb.jpg",120,80,18);thumbnails[661810]=new thumbnail(661810,"50241","Peak Rock, Polperro","IMG_2899_thumb.jpg",120,80,18);thumbnails[661889]=new thumbnail(661889,"50241","Bluebells near Sandplace, Looe","IMG_9799_thumb.jpg",120,180,18);thumbnails[661901]=new thumbnail(661901,"50242","Lake Rock dawn","IMG_62161_thumb.jpg",120,80,18);thumbnails[661777]=new thumbnail(661777,"50242","Roman bridge, Polperro","IMG10342_thumb.jpg",120,180,18);thumbnails[661808]=new thumbnail(661808,"50242","Rocks and island","IMG_04641_thumb.jpg",120,78,18);thumbnails[661813]=new thumbnail(661813,"50242","Sunrise, rocks and sea","IMG_7650_thumb.jpg",120,80,18);thumbnails[661816]=new thumbnail(661816,"50242","Peak Rock storm","IMG_9062_thumb.jpg",120,80,18);thumbnails[661818]=new thumbnail(661818,"50242","Peak Rock, Polperro","IMG_2875_thumb.jpg",120,79,18);thumbnails[661886]=new thumbnail(661886,"50242","Rough Tor shadows","IMG_5581_thumb.jpg",120,80,18);thumbnails[661891]=new thumbnail(661891,"50242","Tree and grass","IMG10758_thumb.jpg",120,80,18);thumbnails[661894]=new thumbnail(661894,"50242","Golitha Falls","IMG_48774_thumb.jpg",120,80,18);thumbnails[661895]=new thumbnail(661895,"50242","Boat and reflections","IMG10094_thumb.jpg",120,180,18);thumbnails[661897]=new thumbnail(661897,"50242","Low tide in Newquay harbour","IMG10692_thumb.jpg",120,180,18);thumbnails[661903]=new thumbnail(661903,"50242","Sea pinks and boat","IMG10078_thumb.jpg",120,147,18);thumbnails[661831]=new thumbnail(661831,"50243","Polperro dawn","IMG_6040_thumb.jpg",120,80,18);thumbnails[661832]=new thumbnail(661832,"50243","Lantivet beach","IMG_07991_thumb.jpg",120,80,18);thumbnails[661833]=new thumbnail(661833,"50243","Lighthouse sunrise","IMG_7748e_thumb.jpg",120,80,18);thumbnails[661834]=new thumbnail(661834,"50243","Lake Rock morning","IMG10981_thumb.jpg",120,80,18);thumbnails[661837]=new thumbnail(661837,"50243","Gunwalloe Cove","IMG_5890_thumb.jpg",120,80,18);thumbnails[661838]=new thumbnail(661838,"50243","Caradon engine house","IMG10911_thumb.jpg",120,180,18);thumbnails[661839]=new thumbnail(661839,"50243","Inner harbour, Polperro","IMG_3919_thumb.jpg",120,84,18);thumbnails[661880]=new thumbnail(661880,"50243","Lake Rock sunrise","IMG_1111_thumb.jpg",120,80,18);thumbnails[661882]=new thumbnail(661882,"50243","Luxulyan water wheel","IMG10791_thumb.jpg",120,180,18);thumbnails[661884]=new thumbnail(661884,"50243","The Hurlers, Caradon","IMG10883_thumb.jpg",120,80,18);thumbnails[661888]=new thumbnail(661888,"50243","Treffry viaduct","IMG10763_thumb.jpg",120,180,18);thumbnails[661893]=new thumbnail(661893,"50243","Chapel sea","IMG11003_thumb.jpg",120,182,18);thumbnails[4907272]=new thumbnail(4907272,"275181","Near Fowey Well under Brown Willy","IMG14488_thumb.jpg",120,80,18);thumbnails[4907169]=new thumbnail(4907169,"275181","Reeds near the source","IMG13123_thumb.jpg",120,80,18);thumbnails[4907174]=new thumbnail(4907174,"275181","Leskernick farm","IMG13147_thumb.jpg",120,69,18);thumbnails[4907277]=new thumbnail(4907277,"275181","Looking up the valley from Codda","IMG14495_thumb.jpg",120,80,18);thumbnails[4907163]=new thumbnail(4907163,"275181","Bluebells in the upper valley","IMG13053_thumb.jpg",120,80,18);thumbnails[4907290]=new thumbnail(4907290,"275181","Golitha Falls","IMG_4877_thumb.jpg",120,80,18);thumbnails[4907318]=new thumbnail(4907318,"275181","Treverbyn Bridge","IMG_9955_1_thumb.jpg",120,80,18);thumbnails[4907153]=new thumbnail(4907153,"275181","Misty morning near Lanreath","IMG125902_thumb.jpg",120,80,18);thumbnails[4907183]=new thumbnail(4907183,"275181","Foxgloves near Colliford Lake","IMG131991_thumb.jpg",120,80,18);thumbnails[4907188]=new thumbnail(4907188,"275181","Wooda bridge on the Warleggan river","IMG13419_thumb.jpg",120,80,18);thumbnails[4907297]=new thumbnail(4907297,"275181","Largin Woods above the Glynn Valley","IMG_7461_thumb.jpg",120,80,18);thumbnails[4907279]=new thumbnail(4907279,"275181","In the Glynn Valley","IMG145501_thumb.jpg",120,80,18);thumbnails[4907232]=new thumbnail(4907232,"275181","Restormel castle under storm clouds","IMG136351_thumb.jpg",120,80,18);thumbnails[4907226]=new thumbnail(4907226,"275181","Sheep grazing below Restormel","IMG135431_thumb.jpg",120,69,18);thumbnails[4907237]=new thumbnail(4907237,"275181","The river at Shirehall Moor","IMG14008_thumb.jpg",120,80,18);thumbnails[4907156]=new thumbnail(4907156,"275181","St Winnow church reflections","IMG12804_thumb.jpg",120,80,18);thumbnails[4907160]=new thumbnail(4907160,"275181","Reflections near St Winnow","IMG12811_thumb.jpg",120,80,18);thumbnails[6143688]=new thumbnail(6143688,"275181","Forgotten boat","IMG15904_thumb.jpg",120,80,18);thumbnails[4907241]=new thumbnail(4907241,"275181","Opposite Penpoll Creek","IMG14179_thumb.jpg",120,80,18);thumbnails[4907245]=new thumbnail(4907245,"275181","Boats at low tide, Golant","IMG14202_thumb.jpg",120,80,18);thumbnails[4907259]=new thumbnail(4907259,"275181","Lerryn reflections","IMG14262_thumb.jpg",120,80,18);thumbnails[4907249]=new thumbnail(4907249,"275181","Lerryn boats","IMG142481_thumb.jpg",120,80,18);thumbnails[4907264]=new thumbnail(4907264,"275181","Kayak below Lerryn","IMG14306_thumb.jpg",120,80,18);thumbnails[4907269]=new thumbnail(4907269,"275181","Canoe at Ethy quay","IMG14321_thumb.jpg",120,78,18);thumbnails[4907287]=new thumbnail(4907287,"275181","Autumn colours and Penquite boathouse","IMG14755_thumb.jpg",120,80,18);thumbnails[4907293]=new thumbnail(4907293,"275181","Boats and reflections off the town quay","IMG_4934_1_thumb.jpg",120,80,18);thumbnails[4907280]=new thumbnail(4907280,"275181","Boats lit by the morning sun, Polruan","IMG146481_thumb.jpg",120,80,18);var galleries=new Object();galleries[50239]=new gallery(50239,"661820,661781,661779","The place","gallery",[661776,661779,661781,661782,661784,661785,661786,661788,661789,661817,661819,661820]);galleries[50245]=new gallery(50245,"661827,661826,661825,661824,661823,661822,661796,661794","The images","gallery",[661793,661794,661795,661796,661821,661822,661823,661824,661825,661826,661827,661829]);galleries[50241]=new gallery(50241,"661889,661809,661805,661804,661799,661792,661791,661790","Tweaking","gallery",[661790,661791,661792,661797,661798,661799,661800,661804,661805,661809,661810,661889]);galleries[50242]=new gallery(50242,"661903,661901,661897,661895,661891,661816,661813,661808","Printing","gallery",[661901,661777,661808,661813,661816,661818,661886,661891,661894,661895,661897,661903]);galleries[50243]=new gallery(50243,"661893,661884,661882,661880,661839,661838,661837,661834,661833,661832,661831","Sharing","gallery",[661831,661832,661833,661834,661837,661838,661839,661880,661882,661884,661888,661893]);galleries[275181]=new gallery(275181,"6143688,4907318,4907297,4907293,4907290,4907287,4907280,4907279,4907277,4907272","The Fowey River Valley","gallery",[4907272,4907169,4907174,4907277,4907163,4907290,4907318,4907153,4907183,4907188,4907297,4907279,4907232,4907226,4907237,4907156,4907160,6143688,4907241,4907245,4907259,4907249,4907264,4907269,4907287,4907293,4907280]);var imageSets=new Object();imageSets[1]="661903,661901,661895,661894,661893,661889,661886,661834,661833,661832,661831,661829,661827,661824,661823,661822,661820,661819,661818,661817,661816,661813,661799,661796,661795,661794,661793,661790,661789,661788,661786,661785,661784,661782,661781,661776";imageSets[2]="661903,661901,661897,661895,661893,661891,661889,661884,661882,661880,661839,661838,661837,661834,661833,661832,661831,661827,661826,661825,661824,661823,661822,661820,661816,661813,661809,661808,661805,661804,661799,661796,661794,661792,661791,661790,661781,661779";imageSets[3]="6143688,4907318,4907297,4907293,4907290,4907287,4907280,4907279,4907277,4907272,4907269,4907264,4907259,4907249,4907245,4907241,4907237,4907232,4907226,4907188,4907183,4907174,4907169,4907163,4907160,4907156,4907153,661903,661901,661897,661895,661894,661893,661891,661889,661888,661886,661884,661882,661880,661839,661838,661837,661834,661833,661832,661831,661829,661827,661826";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/lightpix/images";break}switch(a){case 1:b="http://www1.clikpic.com/lightpix/images";break}switch(a){case 2:b="http://admin.clikpic.com/lightpix/images";break}switch(a){case 24:b="http://tpc15/clikpic/lightpix/images";break}switch(a){case 4:b="http://www.clikchurch.com/lightpix/images";break}switch(a){case 5:b="http://www2.clikpic.com/lightpix/images";break}switch(a){case 22:b="http://tpc5/clikpic/lightpix/images";break}switch(a){case 23:b="http://tpc10/clikpic/lightpix/images";break}switch(a){case 25:b="http://tpc16/clikpic/lightpix/images";break}switch(a){case 15:b="http://www3.clikpic.com/lightpix/images";break}switch(a){case 18:b="http://www4.clikpic.com/lightpix/images";break}switch(a){case 19:b="http://www5.clikpic.com/lightpix/images";break}switch(a){case 31:b="http://www7.clikpic.com/lightpix/images";break}switch(a){case 32:b="http://admin2.clikpic.com/lightpix/images";break}switch(a){case 33:b="http://www8.clikpic.com/lightpix/images";break}switch(a){case 34:b="http://www9.clikpic.com/lightpix/images";break}switch(a){case 35:b="http://admin3.clikpic.com/lightpix/images";break}switch(a){case 37:b="http://admin4.clikpic.com/lightpix/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="Tremorvapix: "+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> 				&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+'<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<120){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+'")'})}}};