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[1711673]=new thumbnail(1711673,"127685","Wilter rose I","rwilted-rose-head-1_thumb.jpg",130,147,18);thumbnails[1715758]=new thumbnail(1715758,"127685","Lilly I in Black and White.","DSC_1106lillysideon1bnw1_thumb.jpg",130,104,18);thumbnails[1715804]=new thumbnail(1715804,"127685","Lilly V Black and White","DSC_1152lillyclose2bnw1_thumb.jpg",130,78,18);thumbnails[1525271]=new thumbnail(1525271,"127960","Sunset over Snowdon","Sunset over Lliwedd_thumb.jpg",130,92,18);thumbnails[1908299]=new thumbnail(1908299,"127683","Cwm Idwal 1.","DSC_3711_3098_thumb.jpg",130,86,18);thumbnails[1908594]=new thumbnail(1908594,"127721","Llyn Padarn","Keepit18431_thumb.jpg",130,190,18);thumbnails[1908896]=new thumbnail(1908896,"127681","Skyline Trees 1","DSCN0101_2572mmmm_thumb.jpg",130,98,18);thumbnails[1978776]=new thumbnail(1978776,"127684","Before the Rain Came","_DSC5149_39777was_thumb.jpg",130,186,18);thumbnails[1983818]=new thumbnail(1983818,"127683","Cwm Idwal In Snow 3","_DSC5213_39826_thumb.jpg",130,197,18);thumbnails[2013225]=new thumbnail(2013225,"127683","Llyn Gwynnant","_DSC5687_160975ws_thumb.jpg",130,196,18);thumbnails[2082898]=new thumbnail(2082898,"127960","Rowing Boat","_DSC5976_161198ws_thumb.jpg",130,189,18);thumbnails[2110553]=new thumbnail(2110553,"127941","Pier 3 Black and White","_DSC6186_161362bnwws_thumb.jpg",130,92,18);thumbnails[2110555]=new thumbnail(2110555,"127684","posts at sunset","_DSC6200_161373ws_thumb.jpg",130,86,18);thumbnails[2148993]=new thumbnail(2148993,"127684","Deralict structure on the beach at sunset","_DSC6722_161652ws_thumb.jpg",130,85,18);thumbnails[2148996]=new thumbnail(2148996,"127684","Deralict structure on the beach.  The sun is setting.","_DSC6731_161660ws_thumb.jpg",130,93,18);thumbnails[2148997]=new thumbnail(2148997,"127684","Calm sunset","_DSC6766_161691ws_thumb.jpg",130,82,18);thumbnails[1908006]=new thumbnail(1908006,"127684","Sea and beach 2.","DSC_3683_3070ws1_thumb.jpg",130,86,18);thumbnails[1908231]=new thumbnail(1908231,"127683","Pen Yr Ole Wen","DSC_3569_2986_thumb.jpg",130,195,18);thumbnails[2110552]=new thumbnail(2110552,"127684"," DSC6183 161359ws","_DSC6183_161359ws_thumb.jpg",130,198,18);thumbnails[1908008]=new thumbnail(1908008,"127684","Sea and beach 3","DSC_3707_3094_thumb.jpg",130,86,18);thumbnails[1908222]=new thumbnail(1908222,"127683","Cwm Idwal 2.","DSC_3716_3103_thumb.jpg",130,195,18);thumbnails[1908007]=new thumbnail(1908007,"127684","Sea and beach 4.","DSC_3691_3078ws_thumb.jpg",130,86,18);thumbnails[2148945]=new thumbnail(2148945,"127684","Distant sunset 2","_DSC6607_161464ws_thumb.jpg",130,196,18);thumbnails[1908104]=new thumbnail(1908104,"127684","Sea and beach 5.","DSC_1822_thumb.jpg",130,86,18);thumbnails[1908105]=new thumbnail(1908105,"127684","Sea and beach 6.","DSC_1825_thumb.jpg",130,85,18);thumbnails[1908175]=new thumbnail(1908175,"127683","Mountain Stream 5.","DSC_3762_3144_thumb.jpg",130,183,18);thumbnails[1908106]=new thumbnail(1908106,"127684","Sea and beach 7.","DSC_1859_thumb.jpg",130,96,18);thumbnails[1525251]=new thumbnail(1525251,"127684","Sea and beach 8.","Talacre 4_edited-1_thumb.jpg",130,194,18);thumbnails[1525334]=new thumbnail(1525334,"127680","Conwy Castle by night","Conwy-Castle_thumb.jpg",130,87,18);thumbnails[1525365]=new thumbnail(1525365,"127681","Oak Leaves on Rock","LOR_thumb.jpg",130,194,18);thumbnails[1542449]=new thumbnail(1542449,"127684","Sea and beach 10.","italy0001_17_thumb.jpg",130,87,18);thumbnails[1630762]=new thumbnail(1630762,"127683","Nant Ffrancon, West of Ogwen Valley.","ogwen-1ws_thumb.jpg",130,194,18);thumbnails[1908261]=new thumbnail(1908261,"127960","Sunset through long grass.","DSC_02491_thumb.jpg",130,75,18);thumbnails[1910659]=new thumbnail(1910659,"127680","Dolwyddelan Castle","Dolwyddelan-Castle_thumb.jpg",130,86,18);thumbnails[1922577]=new thumbnail(1922577,"127721","Trees","DSC_3853_3201_thumb.jpg",130,131,18);thumbnails[1924644]=new thumbnail(1924644,"127721","Trailer II","DSC_4077_3338_thumb.jpg",130,86,18);thumbnails[1955400]=new thumbnail(1955400,"127685","Macro 1","DSC_4610_3761_thumb.jpg",130,111,18);thumbnails[1959692]=new thumbnail(1959692,"127681","Struts on walkway","barr_thumb.jpg",130,86,18);thumbnails[1971294]=new thumbnail(1971294,"127960","Peaceful Trickle","DSC_4816_3892ws_thumb.jpg",130,86,18);thumbnails[1971301]=new thumbnail(1971301,"127721","Windy trees","DSC_4052_3316ws_thumb.jpg",130,86,18);thumbnails[2148943]=new thumbnail(2148943,"127960","Misty forest","_DSC6335_161402ws_thumb.jpg",130,87,18);thumbnails[2148989]=new thumbnail(2148989,"127941","Deralict pier at sunset Black and White","_DSC6678_161614ws_thumb.jpg",130,196,18);thumbnails[1542451]=new thumbnail(1542451,"127684","Sea and beach 11.","italy0001_19_thumb.jpg",130,112,18);thumbnails[1987388]=new thumbnail(1987388,"127684","North Shore","_DSC5251_39848_thumb.jpg",130,189,18);thumbnails[1910666]=new thumbnail(1910666,"127680","St Margaret's Church/Marble Church","mc1_thumb.jpg",130,176,18);thumbnails[1955401]=new thumbnail(1955401,"127685","A Rose I","DSC_4644_3794bnwws_thumb.jpg",130,93,18);thumbnails[2082901]=new thumbnail(2082901,"127960","East of Denbigh","DSC_4101_3348ws_thumb.jpg",130,87,18);thumbnails[2380386]=new thumbnail(2380386,"127681","Cable Car at Llandudno, North Wales","_DSC8840_162275ws_thumb.jpg",130,100,18);thumbnails[1959676]=new thumbnail(1959676,"127941","Breaking Wave 2.","DSC_4579_3737ws_thumb.jpg",130,86,18);thumbnails[2013214]=new thumbnail(2013214,"127684","Sunset on deserted beach II","_DSC5479_39942ws_thumb.jpg",130,183,18);thumbnails[2013224]=new thumbnail(2013224,"127684","Criccieth Groyne","_DSC5592_40030ws_thumb.jpg",130,95,18);thumbnails[1959677]=new thumbnail(1959677,"127941","Jetty - Boat","DSC_4729_3849ws_thumb.jpg",130,86,18);thumbnails[1525314]=new thumbnail(1525314,"127681","Red Maple Leaves","italy0001_5_thumb.jpg",130,91,18);thumbnails[1525339]=new thumbnail(1525339,"127681","Lone Leaf","Lone-leaf_thumb.jpg",130,105,18);thumbnails[1542526]=new thumbnail(1542526,"127721","Snunset over Snowdonia 6","italy0001_161_thumb.jpg",130,46,18);thumbnails[1924647]=new thumbnail(1924647,"127680","Whitchutch","DSC_4116_3354bnw_thumb.jpg",130,86,18);thumbnails[1975484]=new thumbnail(1975484,"128169","Anchor at the harbour with Conwy Castle in the background.","_DSC5137_39765ws_thumb.jpg",130,165,18);thumbnails[1542540]=new thumbnail(1542540,"127681","Swan II","italy0001_31_thumb.jpg",130,87,18);thumbnails[2386335]=new thumbnail(2386335,"127721","Moorland Tree on Denbigh Moors","_DSC0273_162600ws1_thumb.jpg",130,176,18);var galleries=new Object();galleries[127683]=new gallery(127683,"2013225,1983818,1908299,1908231,1908222,1908175","1. Colour Landscape.","gallery",[1908299,1983818,2013225,1908231,1908222,1908175,1630762]);galleries[127960]=new gallery(127960,"2082901,2082898,1971294","2. Colour Landscape","gallery",[1525271,2082898,1908261,1971294,2148943,2082901]);galleries[127721]=new gallery(127721,"1922577","Black and white landscapes","gallery",[1908594,1922577,1924644,1971301,1542526,2386335]);galleries[127680]=new gallery(127680,"1924647,1910666,1910659,1525334","Castles and Churches","gallery",[1525334,1910659,1910666,1924647]);galleries[127719]=new gallery(127719,"2082901,2082898,2013225,1983818,1971294,1922577,1908299,1908231,1908222,1908175","Gallery 1.  Landscapes","gallery",[]);galleries[127936]=new gallery(127936,"2148997,2148993,2148945,2110555,2110553,2110552,1978776,1959677,1959676,1908106,1908105,1908104,1908008,1908007,1908006,1542449,1525251","Gallery 2.  Sea and Beach","gallery",[]);galleries[127681]=new gallery(127681,"2380386,1959692,1908896,1542540,1525365,1525339","Gallery 3. Simple","gallery",[1908896,1525365,1959692,2380386,1525314,1525339,1542540]);galleries[127714]=new gallery(127714,"1975484,1924647,1910666,1910659,1525334","Gallery 4.  People and places","gallery",[]);galleries[127685]=new gallery(127685,"1955401,1955400,1715804","Gallery 5.  Flowers.","gallery",[1711673,1715758,1715804,1955400,1955401]);galleries[127941]=new gallery(127941,"2110553,1959677,1959676","Sea and Beach Black and White","gallery",[2110553,2148989,1959676,1959677]);galleries[127684]=new gallery(127684,"2148997,2148993,2148945,2110555,2110552,1978776,1908106,1908105,1908104,1908008,1908007,1908006,1542449,1525251","Sea and Beach Colour","gallery",[1978776,2110555,2148993,2148996,2148997,1908006,2110552,1908008,1908007,2148945,1908104,1908105,1908106,1525251,1542449,1542451,1987388,2013214,2013224]);galleries[128169]=new gallery(128169,"1975484","Towns and Streets","gallery",[1975484]);var imageSets=new Object();imageSets[1]="2380386,2148997,2148993,2110555,2110553,2110552,2082901,2082898,2013225,1983818,1978776,1975484,1971294,1955401,1924647,1922577,1910666,1908299,1908222,1908175,1908106,1908008,1908007,1908006,1715804,1542540,1542449";imageSets[2]="2380386,2148997,2148993,2148945,2110555,2110553,2110552,2082901,2082898,2013225,1983818,1978776,1975484,1971294,1959692,1959677,1959676,1955401,1955400,1924647,1922577,1910666,1910659,1908896,1908299,1908231,1908222,1908175,1908106,1908105,1908104,1908008,1908007,1908006,1715804,1542540,1542449,1525365,1525339,1525334,1525251";imageSets[3]="2386335,2380386,2148997,2148996,2148993,2148989,2148945,2148943,2110555,2110553,2110552,2082901,2082898,2013225,2013224,2013214,1987388,1983818,1978776,1975484,1971301,1971294,1959692,1959677,1959676,1955401,1955400,1924647,1924644,1922577,1910666,1910659,1908896,1908594,1908299,1908261,1908231,1908222,1908175,1908106,1908105,1908104,1908008,1908007,1908006,1715804,1715758,1711673,1630762,1542540";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/darrenwilliams/images";break}switch(a){case 1:b="http://www1.clikpic.com/darrenwilliams/images";break}switch(a){case 2:b="http://admin.clikpic.com/darrenwilliams/images";break}switch(a){case 4:b="http://www.clikchurch.com/darrenwilliams/images";break}switch(a){case 5:b="http://www2.clikpic.com/darrenwilliams/images";break}switch(a){case 15:b="http://www3.clikpic.com/darrenwilliams/images";break}switch(a){case 21:b="http://www6.clikpic.com/darrenwilliams/images";break}switch(a){case 18:b="http://www4.clikpic.com/darrenwilliams/images";break}switch(a){case 19:b="http://www5.clikpic.com/darrenwilliams/images";break}switch(a){case 22:b="http://tpc5/clikpic/darrenwilliams/images";break}switch(a){case 23:b="http://tpc10/clikpic/darrenwilliams/images";break}switch(a){case 24:b="http://tpc15/clikpic/darrenwilliams/images";break}switch(a){case 25:b="http://tpc16/clikpic/darrenwilliams/images";break}switch(a){case 31:b="http://www7.clikpic.com/darrenwilliams/images";break}switch(a){case 32:b="http://admin2.clikpic.com/darrenwilliams/images";break}switch(a){case 33:b="http://www8.clikpic.com/darrenwilliams/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="Landscape & Nature Photography UK North Wales: "+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="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="darrenwilliamspsych@live.co.uk">';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="darrenwilliamspsych@live.co.uk">';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+'")'})}}};