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[3718517]=new thumbnail(3718517,"","","trebarwith_strand___1_thumb.jpg",130,61,15);thumbnails[3800920]=new thumbnail(3800920,"","","Trebarwith_Strand8_thumb.jpg",130,63,15);thumbnails[3819296]=new thumbnail(3819296,"","","TINTAGEL_2_thumb.jpg",130,81,15);thumbnails[3819297]=new thumbnail(3819297,"","","TINTAGEL_3_thumb.jpg",130,81,15);thumbnails[3819413]=new thumbnail(3819413,"","","trebarwith_thumb.jpg",130,68,15);thumbnails[5392301]=new thumbnail(5392301,"","","photo_canvas__copy_thumb.jpg",130,57,15);thumbnails[5392302]=new thumbnail(5392302,"","","canvas_photo_beach_thumb.jpg",130,68,15);thumbnails[5392303]=new thumbnail(5392303,"","","canvas_picture_thumb.jpg",130,109,15);thumbnails[5392304]=new thumbnail(5392304,"","","canvas_2_thumb.jpg",130,42,15);thumbnails[5392305]=new thumbnail(5392305,"","","photo_canvas___thumb.jpg",130,277,15);thumbnails[6138160]=new thumbnail(6138160,"","","cornwall_photos_thumb.gif",130,28,15);thumbnails[6138219]=new thumbnail(6138219,"","","BLACK_FINISHED_boscastle_thumb.jpg",130,93,15);thumbnails[6138220]=new thumbnail(6138220,"","","WHITE_FINISHED_SMALL1_thumb.jpg",130,93,15);thumbnails[6138229]=new thumbnail(6138229,"","","BLACK_FINISHED_huts1_thumb.jpg",130,169,15);thumbnails[6138230]=new thumbnail(6138230,"","","footsteps_121B5418-24E8-5EC4-4F538E97D24EFE6A_copy_thumb.jpg",130,169,15);thumbnails[3819433]=new thumbnail(3819433,"232773","Trebarwith Gold - Trebarwith Strand ","The_Strand_TRIP_thumb.jpg",130,85,15);thumbnails[3819511]=new thumbnail(3819511,"232773","The Rumps - Cornwall","Rumps_point_TRIP_thumb.jpg",130,85,15);thumbnails[3819520]=new thumbnail(3819520,"232773","Greeb Zawn Bay - Land's End","lands-end_TRIP_thumb.jpg",130,85,15);thumbnails[6138549]=new thumbnail(6138549,"232773","Trebarwith Strand, Cornwall","trebarwith_strand_triptych_copy1_thumb.jpg",130,85,15);thumbnails[6138572]=new thumbnail(6138572,"232773","Summer In The Dunes - Crantock, Cornwall","Summer_In_The_Dunes_Crantock_Cornwall_0BD3783F-24E8-5EC4-4FBC0707A6D97664_thumb.jpg",130,85,15);thumbnails[6138594]=new thumbnail(6138594,"232773","Sunlight reflecting off the lighthouse - Godrevy","Sunlight_reflecting_off_the_lighthouse_triptych_thumb.jpg",130,85,15);thumbnails[6138615]=new thumbnail(6138615,"232773","Bathed in golden light - Porth Nanven, Cornwall","Bathed_in_golden_light_Porth_Nanven_1496C4CA-24E8-5EC4-4F233719D30A6995_thumb.jpg",130,85,15);thumbnails[6138637]=new thumbnail(6138637,"232773","A Little Sand Between Your Toes - Gwithian Towans, Cornwall","upton_towans_triptychs_thumb.jpg",130,85,15);thumbnails[3819570]=new thumbnail(3819570,"232773","Returning Tide - St Michael's Mount","st_michaels_MountTRIP_thumb.jpg",130,85,15);thumbnails[3819566]=new thumbnail(3819566,"232773","Turbulent Seas - Trevose Lighthouse","Trevose_lighthouse_TRIP_thumb.jpg",130,85,15);thumbnails[3819505]=new thumbnail(3819505,"232773","Boulder Beach - Porth Nanven","_porth__nanven_TRIP_thumb.jpg",130,85,15);thumbnails[3819567]=new thumbnail(3819567,"232773","Circle In The Sand - St Michael's Mount","marazion_TRIP_thumb.jpg",130,85,15);thumbnails[3819571]=new thumbnail(3819571,"232773","Bluebell Woodland - Micheldever","Bluebell_Woodland_TRIP_thumb.jpg",130,85,15);thumbnails[3819572]=new thumbnail(3819572,"232773","Morning Rays - Surrey","Sun_Rays_TRIP_thumb.jpg",130,85,15);thumbnails[6138506]=new thumbnail(6138506,"232773","Autumn rays - Surrey","autumn_rays_TRIP_thumb.jpg",130,85,15);thumbnails[6138493]=new thumbnail(6138493,"232773","Standing Together - Exmoor","Exmoor_Dawn_TRIP_copy1_thumb.jpg",130,85,15);thumbnails[6138467]=new thumbnail(6138467,"232773","Poppies","POPPIES_TRIPTYCH_thumb.jpg",130,85,15);thumbnails[6138462]=new thumbnail(6138462,"232773","Foxgloves","foxgloves_triptych_thumb.jpg",130,85,15);thumbnails[6138456]=new thumbnail(6138456,"232773","Sunflowers","SUNFLOWERS_TRIPTYCH_thumb.jpg",130,85,15);thumbnails[6138323]=new thumbnail(6138323,"232773","Crocuses","FLOWERS_TRIPTYCH1_thumb.jpg",130,85,15);thumbnails[3718158]=new thumbnail(3718158,"226609","The Strand - Trebarwith Strand, Cornwall","trebarwith_strand1_thumb.jpg",130,86,15);thumbnails[3717838]=new thumbnail(3717838,"226609","Trebarwith Gold - Trebarwith Strand, Cornwall","trebarwith_strand__1_thumb.jpg",130,87,15);thumbnails[6138664]=new thumbnail(6138664,"226609","Trebarwith Strand at sunset - Cornwall ","Trebarwith_Strand_at_sunset_north_Cornwall_3_9CA8662F-24E8-5EC4-4F58E5664275A981_thumb.jpg",130,88,15);thumbnails[3718239]=new thumbnail(3718239,"226609","Gull Rock - Trebarwith Strand, Cornwall","trebarwith_strand____thumb.jpg",130,87,15);thumbnails[5392247]=new thumbnail(5392247,"226609","Lower Penhallic Point - Trebarwith Strand, Cornwall","image12590_thumb.jpg",130,87,15);thumbnails[5392252]=new thumbnail(5392252,"226609","Trebarwith Strand, Form Port William, Cornwall","image14421_thumb.jpg",130,87,15);thumbnails[5392218]=new thumbnail(5392218,"226609","View from Coastal Path - Trebarwith Strand, Cornwall","image07945_thumb.jpg",130,87,15);thumbnails[5392255]=new thumbnail(5392255,"226609","Trebarwth Strand, From Port William II, Cornwall","image12542_thumb.jpg",130,87,15);thumbnails[6138670]=new thumbnail(6138670,"226609","Slate Stacks - Trebarwith Strand, Cornwall","trebarwith_strand_slate_thumb.jpg",130,87,15);thumbnails[6138672]=new thumbnail(6138672,"226609","Above The Port William - Trebarwith Strand, Cornwall","trebarwith_strand_above_thumb.jpg",130,87,15);thumbnails[6138674]=new thumbnail(6138674,"226609","Sunny Days - Trebarwith Strand, Cornwall","trebarwith_strand_2CCA8EF2-24E8-5EC4-4F314DB02C5DA998_thumb.jpg",130,87,15);thumbnails[6138677]=new thumbnail(6138677,"226609","Low Tide - Trebarwith Strand, Cornwall","trebarwith_strand_beach_thumb.jpg",130,87,15);thumbnails[6138682]=new thumbnail(6138682,"226609","Trebarwith Strand at Low Tide, Cornwall","Trebarwith_Strand_at_Low_Tide_thumb.jpg",130,87,15);thumbnails[6138688]=new thumbnail(6138688,"226609","Rocks at Trebarwith Strand - Cornwall","Rocks_at_Trebarwith_Strand_90A5A79B-1EC9-D45B-1C246D9B35355214_thumb.jpg",130,87,15);thumbnails[6138697]=new thumbnail(6138697,"226609","Gorse at Trebarwith - Cornwall","Gorse_at_Trebarwith_90A5A5B6-1EC9-D45B-1C9CE83DFC2E00D51_thumb.jpg",130,87,15);thumbnails[6138717]=new thumbnail(6138717,"226609","Low Tide at Trebarwith Strand - Cornwall","Low_Tide_at_Trebarwith_Strand_thumb.jpg",130,87,15);thumbnails[5392256]=new thumbnail(5392256,"304300","","image07961_thumb.jpg",130,87,15);thumbnails[3718336]=new thumbnail(3718336,"304299","","Rumps_point_thumb.jpg",130,87,15);thumbnails[3800616]=new thumbnail(3800616,"304299","","porthcurno__thumb.jpg",130,87,15);thumbnails[3800617]=new thumbnail(3800617,"304299","","_porth__nanven_thumb.jpg",130,86,15);thumbnails[3718340]=new thumbnail(3718340,"304299","","lands-end_thumb.jpg",130,87,15);thumbnails[3800633]=new thumbnail(3800633,"304299","","Trevose_lighthouse_thumb.jpg",130,86,15);thumbnails[3800637]=new thumbnail(3800637,"304299","","mullion_thumb.jpg",130,87,15);thumbnails[3800619]=new thumbnail(3800619,"304299","","marazion_thumb.jpg",130,87,15);thumbnails[3800626]=new thumbnail(3800626,"304299","","gunwalloe--_thumb.jpg",130,85,15);thumbnails[3717709]=new thumbnail(3717709,"226610","Follow The Flow - Trebarwith Strand, Cornwall","trebarwith_strand_thumb.jpg",130,195,15);thumbnails[3800554]=new thumbnail(3800554,"226610","A Circle In Stone - Trebarwith Strand, Cornwall","trebarwith_strand_____thumb.jpg",130,197,15);thumbnails[3800564]=new thumbnail(3800564,"226610","Evening Sun - Trebarwith Strand, Cornwall","trebarwith_strand__________thumb.jpg",130,196,15);thumbnails[3800567]=new thumbnail(3800567,"226610","Incoming Tide - Trebarwith Strand, Cornwall","trebarwith_strand_________thumb.jpg",130,197,15);thumbnails[3800573]=new thumbnail(3800573,"226610","Misty Waters - Trebarwith Strand, Cornwall","trebarwith_strand______thumb.jpg",130,195,15);thumbnails[3800575]=new thumbnail(3800575,"226610","Channelled Through Time - Trebarwith Strand, Cornwall","trebarwith_strand2_thumb.jpg",130,195,15);thumbnails[3800589]=new thumbnail(3800589,"226610","Final Glow - Trebarwith Strand, Cornwall","trebarwith_strand___________thumb.jpg",130,196,15);var galleries=new Object();galleries[232773]=new gallery(232773,"6138637,6138615,6138594,6138572,6138549,6138506,6138493,6138467,6138462,6138456","TRIPTYCH'S","section284174",[3819433,3819511,3819520,6138549,6138572,6138594,6138615,6138637,3819570,3819566,3819505,3819567,3819571,3819572,6138506,6138493,6138467,6138462,6138456,6138323]);galleries[226609]=new gallery(226609,"6138717,6138697,6138688,6138682,6138677,6138674,6138672,6138670,6138664,5392255","TREBARWITH STRAND I","gallery",[3718158,3717838,6138664,3718239,5392247,5392252,5392218,5392255,6138670,6138672,6138674,6138677,6138682,6138688,6138697,6138717]);galleries[304300]=new gallery(304300,"5392256","TINTAGEL","gallery",[5392256]);galleries[304299]=new gallery(304299,"3800637,3800633,3800626,3800619,3800617,3800616,3718340,3718336","CORNWALL","gallery",[3718336,3800616,3800617,3718340,3800633,3800637,3800619,3800626]);galleries[304301]=new gallery(304301,"","BOSCASTLE","gallery",[]);galleries[226610]=new gallery(226610,"3800589,3800575,3800573,3800567,3800564,3800554,3717709","TREBARWITH STRAND II","gallery",[3717709,3800554,3800564,3800567,3800573,3800575,3800589]);var imageSets=new Object();imageSets[1]="5392255,5392252,5392247,5392218,3718340,3718239,3718158,3717838";imageSets[3]="3819572,3819571,3819570,3819567,3819566,3819520,3819511,3819505,3819433,3819413,3819297,3819296,3800920,3800637,3800633,3800619,3800617,3800589,3800575,3800573,3800567,3800564,3800554,3718517,3718340,3718239,3718158,3717838,3717709";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/trebarwith/images";break}switch(a){case 1:b="http://www1.clikpic.com/trebarwith/images";break}switch(a){case 2:b="http://admin.clikpic.com/trebarwith/images";break}switch(a){case 24:b="http://tpc15/clikpic/trebarwith/images";break}switch(a){case 4:b="http://www.clikchurch.com/trebarwith/images";break}switch(a){case 5:b="http://www2.clikpic.com/trebarwith/images";break}switch(a){case 22:b="http://tpc5/clikpic/trebarwith/images";break}switch(a){case 23:b="http://tpc10/clikpic/trebarwith/images";break}switch(a){case 25:b="http://tpc16/clikpic/trebarwith/images";break}switch(a){case 15:b="http://www3.clikpic.com/trebarwith/images";break}switch(a){case 18:b="http://www4.clikpic.com/trebarwith/images";break}switch(a){case 19:b="http://www5.clikpic.com/trebarwith/images";break}switch(a){case 31:b="http://www7.clikpic.com/trebarwith/images";break}switch(a){case 32:b="http://admin2.clikpic.com/trebarwith/images";break}switch(a){case 33:b="http://www8.clikpic.com/trebarwith/images";break}switch(a){case 34:b="http://www9.clikpic.com/trebarwith/images";break}switch(a){case 35:b="http://admin3.clikpic.com/trebarwith/images";break}switch(a){case 37:b="http://admin4.clikpic.com/trebarwith/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="Trebarwith Strand: "+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>"}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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';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">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="TREBARWITH">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";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+'")'})}}};