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[4462809]=new thumbnail(4462809,"100891","Evening Close","DSC_0092_thumb.jpg",130,199,18);thumbnails[4462820]=new thumbnail(4462820,"100891","Casting Off","DSC_0073_thumb.jpg",130,196,18);thumbnails[4462815]=new thumbnail(4462815,"100891","Summer Cliffs","DSC_0062_thumb.jpg",130,199,18);thumbnails[4462814]=new thumbnail(4462814,"100891","Looking out<br>\r\n","DSC_0073_2_thumb.jpg",130,196,18);thumbnails[4462818]=new thumbnail(4462818,"100891","Fading Light","DSC_00601_thumb.jpg",130,199,18);thumbnails[4462822]=new thumbnail(4462822,"100891","Reflections","DSC_0009_thumb.jpg",130,86,18);thumbnails[4462829]=new thumbnail(4462829,"100891","Rock Stripes","DSC_0061_thumb.jpg",130,86,18);thumbnails[4462819]=new thumbnail(4462819,"100891","A Welcome Stop","DSC_0001_thumb.jpg",130,108,18);thumbnails[1528108]=new thumbnail(1528108,"85348","Misty Sea","DSC_0196_thumb.jpg",130,194,18);thumbnails[2085790]=new thumbnail(2085790,"85348","Sunlit Evening","DSC_0022_2_thumb.jpg",130,194,18);thumbnails[1302739]=new thumbnail(1302739,"85348","Coastal Glow","DSC_0004_edited-3_thumb.jpg",130,85,18);thumbnails[1602791]=new thumbnail(1602791,"85348","Rockpool Reflections","DSC_0047_thumb.jpg",130,199,18);thumbnails[1672318]=new thumbnail(1672318,"85348","Lone Stone","DSC_0063_thumb.jpg",130,194,18);thumbnails[2751368]=new thumbnail(2751368,"85348","Cloud Streaks","DSC_0003_thumb.jpg",130,87,18);thumbnails[1303301]=new thumbnail(1303301,"85348","Waiting for the Tide","DSC_0027_thumb.jpg",130,87,18);thumbnails[1461763]=new thumbnail(1461763,"85348","Last Light","DSC_903_thumb.jpg",130,194,18);thumbnails[1602966]=new thumbnail(1602966,"85348","Dune View","DSC_0087_thumb.jpg",130,197,18);thumbnails[1527996]=new thumbnail(1527996,"85348","Quiet Seas","DSC_0025_thumb.jpg",130,194,18);thumbnails[3649968]=new thumbnail(3649968,"85349","Starlings to Roost","DSC_0064_edited-2_thumb.jpg",130,195,18);thumbnails[2085785]=new thumbnail(2085785,"85349","Staggered Rocks","DSC_0050_3_thumb.jpg",130,194,18);thumbnails[1302809]=new thumbnail(1302809,"85349","Looking West","Img_1104_thumb.jpg",130,196,18);thumbnails[1302816]=new thumbnail(1302816,"85349","Sun Down","Img_1095_thumb.jpg",130,91,18);thumbnails[1743433]=new thumbnail(1743433,"85349","Cloudy Highlights","DSC_0025_21_thumb.jpg",130,88,18);thumbnails[1343501]=new thumbnail(1343501,"85349","Balancing stones","DSC_00491_thumb.jpg",130,194,2);thumbnails[1343504]=new thumbnail(1343504,"85349","Heart Shaped Rock","DSC_00101_thumb.jpg",130,191,18);thumbnails[1672306]=new thumbnail(1672306,"85351","Keeping Watch","DSC_0204_thumb.jpg",130,197,18);thumbnails[1343499]=new thumbnail(1343499,"85351","Stretching to Ramsey","DSC_0004_thumb.jpg",130,194,18);thumbnails[1302823]=new thumbnail(1302823,"85351","Stormy Day","Img_0792_thumb.jpg",130,96,18);thumbnails[1302824]=new thumbnail(1302824,"85351","A Splash of Colour","DSC_0014_thumb.jpg",130,68,18);thumbnails[1743399]=new thumbnail(1743399,"85351","Setting Out","DSC_0042_thumb.jpg",130,87,18);thumbnails[1302828]=new thumbnail(1302828,"85351","Cascading Flowers","DSC_0030_thumb.jpg",130,87,18);thumbnails[1857934]=new thumbnail(1857934,"85351","Mind the Gap","DSC_0033_thumb.jpg",130,198,18);thumbnails[1302832]=new thumbnail(1302832,"85351","Looking towards the Sun","Dscn1230_thumb.jpg",130,180,18);thumbnails[1302862]=new thumbnail(1302862,"85351","The Deerpark","Img_1758_thumb.jpg",130,195,18);thumbnails[1343516]=new thumbnail(1343516,"85351","Evening Glow","DSC_0103_copy1_thumb.jpg",130,83,18);thumbnails[1343558]=new thumbnail(1343558,"85351","Above in the peace","Dscn0157_thumb.jpg",130,95,18);thumbnails[1528086]=new thumbnail(1528086,"85351","Hazy Moon","DSC_0153_thumb.jpg",130,203,18);thumbnails[1672321]=new thumbnail(1672321,"85352","Oceans Power","DSC_0069_thumb.jpg",130,86,18);thumbnails[1302887]=new thumbnail(1302887,"85352","Frozen in Time","DSC_0097_thumb.jpg",130,197,18);thumbnails[1602920]=new thumbnail(1602920,"85352","A Winter's Wave","DSC_0011_thumb.jpg",130,196,18);thumbnails[2029878]=new thumbnail(2029878,"85352","Tumbling","DSC_0108_thumb.jpg",130,198,18);thumbnails[1672310]=new thumbnail(1672310,"117283","A Winters Ocean","DSC_0029 copy_thumb.jpg",130,84,18);thumbnails[1672311]=new thumbnail(1672311,"117283","Storm Force","DSC_0055 copy_thumb.jpg",130,87,18);thumbnails[1743387]=new thumbnail(1743387,"117283","Winter Breakers","DSC_0044_thumb.jpg",130,88,18);thumbnails[1302825]=new thumbnail(1302825,"117283","Awaiting Harvest","DSC_001814_thumb.jpg",130,85,18);thumbnails[1527761]=new thumbnail(1527761,"117283","Clouds Away","DSC_0009b_thumb.jpg",130,194,18);thumbnails[1743167]=new thumbnail(1743167,"117283","Winter's Morning","DSC_0014_21_thumb.jpg",130,87,18);thumbnails[1302806]=new thumbnail(1302806,"117283","Enjoying the View","DSC_0095jpg2_thumb.jpg",130,194,18);thumbnails[1528037]=new thumbnail(1528037,"117283","Mackeral Sky","DSC_0074_thumb.jpg",130,194,18);thumbnails[1743160]=new thumbnail(1743160,"85353","Frosty Dawn","DSC_0047_21_thumb.jpg",130,87,18);thumbnails[1461750]=new thumbnail(1461750,"85353","A Timeless View","DSC_907_thumb.jpg",130,93,18);thumbnails[1857941]=new thumbnail(1857941,"85353","Dawn at the Estuary ","DSC_0006_thumb.jpg",130,92,18);thumbnails[1461765]=new thumbnail(1461765,"85353","Lifting Clouds","DSC_906_thumb.jpg",130,193,18);thumbnails[1302890]=new thumbnail(1302890,"85353","Balancing","CSC_0065_thumb.jpg",130,173,18);thumbnails[1461738]=new thumbnail(1461738,"85353","Two's Company","DSC_901_thumb.jpg",130,201,18);thumbnails[3649953]=new thumbnail(3649953,"85353","Snow Drops","DSC_0111_thumb.jpg",130,196,18);thumbnails[1302895]=new thumbnail(1302895,"85353","Busy Bee","DSC_0013_edited-1_thumb.jpg",130,194,18);thumbnails[1462024]=new thumbnail(1462024,"85353","Firey Sky","DSC_905_thumb.jpg",130,189,18);thumbnails[2751370]=new thumbnail(2751370,"85353","Coastal Flowers","DSC_0085_21_thumb.jpg",130,194,18);thumbnails[1302904]=new thumbnail(1302904,"85353","Catch of the Day","Dscn0188_thumb.jpg",130,96,18);thumbnails[1302907]=new thumbnail(1302907,"85353","Springtime","Img_1826_thumb.jpg",130,103,18);thumbnails[1527989]=new thumbnail(1527989,"85353","Autumn Splendor","DSC_0010_212345_thumb.jpg",130,208,18);thumbnails[1602968]=new thumbnail(1602968,"85353","Rocky Falls","DSC_0031_2_thumb.jpg",130,198,18);thumbnails[1743361]=new thumbnail(1743361,"85353","Standing Tall","DSC_0060_thumb.jpg",130,198,18);thumbnails[1527771]=new thumbnail(1527771,"85353","Evening on Plumstone","DSC_0012_thumb.jpg",130,194,18);thumbnails[1528067]=new thumbnail(1528067,"85353","Estuary Haze","DSC_0100_2_thumb.jpg",130,87,18);thumbnails[2883931]=new thumbnail(2883931,"178926","","DSC_0164_edited-14_thumb.jpg",130,194,18);thumbnails[2883966]=new thumbnail(2883966,"178926","","DSC_0008_edited-1_thumb.jpg",130,194,18);thumbnails[2883934]=new thumbnail(2883934,"178926","","DSC_0159_edited-1_thumb.jpg",130,194,18);thumbnails[2883943]=new thumbnail(2883943,"178926","","DSC_0147_edited-11_thumb.jpg",130,194,18);thumbnails[2883965]=new thumbnail(2883965,"178926","","DSC_0027_edited-1_thumb.jpg",129,90,18);thumbnails[2883942]=new thumbnail(2883942,"178926","","DSC_0151_edited-1_thumb.jpg",129,90,18);thumbnails[2922920]=new thumbnail(2922920,"180841","","Untitled_Panorama1_edited-13_thumb.jpg",130,46,18);thumbnails[2922925]=new thumbnail(2922925,"180841","","1_edited-1_thumb.jpg",130,46,18);thumbnails[2924564]=new thumbnail(2924564,"180841","","2_edited-23_thumb.jpg",130,46,18);thumbnails[2924575]=new thumbnail(2924575,"180841","","4 images_edited-2_thumb.jpg",130,46,18);thumbnails[2924588]=new thumbnail(2924588,"180841","","STA_0688_edited-1_thumb.jpg",130,46,18);var galleries=new Object();galleries[100891]=new gallery(100891,"4462809","Latest work","gallery",[4462809,4462820,4462815,4462814,4462818,4462822,4462829,4462819]);galleries[85348]=new gallery(85348,"1602966","Beaches","gallery",[1528108,2085790,1302739,1602791,1672318,2751368,1303301,1461763,1602966,1527996]);galleries[85349]=new gallery(85349,"2085785,1302809","Sunrise/Sunsets","gallery",[3649968,2085785,1302809,1302816,1743433,1343501,1343504]);galleries[85351]=new gallery(85351,"1857934,1672306,1302862","Coastal Path ","gallery",[1672306,1343499,1302823,1302824,1743399,1302828,1857934,1302832,1302862,1343516,1343558,1528086]);galleries[85352]=new gallery(85352,"1302887","Surf/Sea","gallery",[1672321,1302887,1602920,2029878]);galleries[117283]=new gallery(117283,"1302806","Black & White","gallery",[1672310,1672311,1743387,1302825,1527761,1743167,1302806,1528037]);galleries[85353]=new gallery(85353,"1462024","Other Photos","gallery",[1743160,1461750,1857941,1461765,1302890,1461738,3649953,1302895,1462024,2751370,1302904,1302907,1527989,1602968,1743361,1527771,1528067]);galleries[178926]=new gallery(178926,"2883934","Aerial Photos","gallery",[2883931,2883966,2883934,2883943,2883965,2883942]);galleries[180841]=new gallery(180841,"2922920","Panoramic","gallery",[2922920,2922925,2924564,2924575,2924588]);var imageSets=new Object();imageSets[1]="1743160";imageSets[2]="4462809,2922920,2883934,2085785,1857934,1672306,1602966,1462024,1302887,1302862,1302809,1302806";imageSets[3]="3649953";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 34:b="http://www9.clikpic.com/james_slowgrove/images";break}switch(a){case 1:b="http://www1.clikpic.com/james_slowgrove/images";break}switch(a){case 2:b="http://admin.clikpic.com/james_slowgrove/images";break}switch(a){case 4:b="http://www.clikchurch.com/james_slowgrove/images";break}switch(a){case 5:b="http://www2.clikpic.com/james_slowgrove/images";break}switch(a){case 15:b="http://www3.clikpic.com/james_slowgrove/images";break}switch(a){case 21:b="http://www6.clikpic.com/james_slowgrove/images";break}switch(a){case 18:b="http://www4.clikpic.com/james_slowgrove/images";break}switch(a){case 19:b="http://www5.clikpic.com/james_slowgrove/images";break}switch(a){case 22:b="http://tpc5/clikpic/james_slowgrove/images";break}switch(a){case 23:b="http://tpc10/clikpic/james_slowgrove/images";break}switch(a){case 24:b="http://tpc15/clikpic/james_slowgrove/images";break}switch(a){case 25:b="http://tpc16/clikpic/james_slowgrove/images";break}switch(a){case 31:b="http://www7.clikpic.com/james_slowgrove/images";break}switch(a){case 32:b="http://admin2.clikpic.com/james_slowgrove/images";break}switch(a){case 33:b="http://www8.clikpic.com/james_slowgrove/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="Pembrokeshire Pics: "+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+"</p>";var e=c.purchase_instruction;var d=c.item_price;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="james_slowgrove@hotmail.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="james_slowgrove@hotmail.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+'")'})}}};