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[127525]=new thumbnail(127525,"","Wenallt Cardiff ,Bluebell Time","Bluebells, Wenallt, Cardiff1_thumb.jpg",130,200,1);thumbnails[159723]=new thumbnail(159723,"","Llyn Tegid, Y Bala ","Llyn Tegid, Bala, Gwynedd_thumb.jpg",130,83,1);thumbnails[159731]=new thumbnail(159731,"","Wales Millenium Centre, Cardiff Bay","Wales Millenium Centre1_thumb.jpg",130,86,1);thumbnails[159744]=new thumbnail(159744,"","Near Strumble Head, Pembrokeshire","Near Strumble Head1_thumb.jpg",130,84,1);thumbnails[159751]=new thumbnail(159751,"","Newgale Sands , Pembrokeshire","Newgale Sands Pembrokeshire1_thumb.jpg",130,84,1);thumbnails[1987278]=new thumbnail(1987278,"","Sennedd Building  & Merchant Marine Memorial","DSC_0005_thumb.JPG",130,86,1);thumbnails[82780]=new thumbnail(82780,"","Coed y Bwnydd near Usk in Bluebell time","Coed y Bwnydd in Bluebell Time_thumb.jpg",130,195,1);thumbnails[82833]=new thumbnail(82833,"","Crocus Study","Crocus Heart_thumb.jpg",130,90,1);thumbnails[82766]=new thumbnail(82766,"","Traeth Llfyn, Pembrokeshire","Traeth Llyfn, Pembrokeshire_thumb.jpg",130,210,1);thumbnails[82845]=new thumbnail(82845,"","Snowdrop","Snowdrop_thumb.jpg",130,203,1);thumbnails[1263308]=new thumbnail(1263308,"5455","Evening, Llyn Tegid, Bala","Evening, LLyn Tegid Bala_thumb.jpg",130,87,1);thumbnails[5299627]=new thumbnail(5299627,"5455","Porthclais, Pembrokeshire","DSC_0175_thumb.JPG",130,195,1);thumbnails[5299660]=new thumbnail(5299660,"5455","RHOSILI BAY GOWER","DSC_0762_thumb.jpg",130,86,1);thumbnails[5299669]=new thumbnail(5299669,"5455","Newgale Pembrokeshire","DSC_1040_thumb.jpg",130,195,1);thumbnails[5299677]=new thumbnail(5299677,"5455","Three Cliffs Bay, Gower","DSC_0747_thumb.jpg",130,93,1);thumbnails[5328593]=new thumbnail(5328593,"5455","PORTHDINLLAEN, LLEYN","DSC_2670_thumb.JPG",130,87,1);thumbnails[5342798]=new thumbnail(5342798,"5455","Storm Brewing Over Gospel Pass, Gwent","DSC_1370_thumb.jpg",130,86,1);thumbnails[5342873]=new thumbnail(5342873,"5455","Three Cliffs Bay Gower","DSC_0715_thumb.jpg",130,86,1);thumbnails[5343136]=new thumbnail(5343136,"5455","Snowtime in Snowdonia","image-2_thumb.jpg",130,82,1);thumbnails[5343161]=new thumbnail(5343161,"5455","Brecon Beacons in Autumn","DSC_3076_thumb.JPG",130,87,1);thumbnails[5343162]=new thumbnail(5343162,"5455","Roath Park in Autumn","DSC_3120_thumb.JPG",130,193,1);thumbnails[5343168]=new thumbnail(5343168,"5455","Capel y Ffin Gospel Pass Gwent","DSC_1385_thumb.jpg",130,86,1);thumbnails[5343169]=new thumbnail(5343169,"5455","Llynoedd Mymbr & Snowden Ring","image-7_thumb.jpg",130,82,1);thumbnails[5343173]=new thumbnail(5343173,"5455","Brecon Beacons from the West","image-6_thumb.jpg",130,87,1);thumbnails[5343367]=new thumbnail(5343367,"5455","Bluebell Time , Wenallt ,Cardiff","DSC_2016_thumb.JPG",130,194,1);thumbnails[5343406]=new thumbnail(5343406,"5455","Stones of Pembrokeshire","2009_06_12_0013-1_thumb.jpg",130,87,1);thumbnails[5343638]=new thumbnail(5343638,"5455","Llangorse Lake & Brecon Beacons","DSC_0047_thumb.jpg",130,93,1);thumbnails[5343680]=new thumbnail(5343680,"5455","Mawddach Estuary, Gwynedd","DSC_0050_thumb.jpg",130,86,1);thumbnails[5343784]=new thumbnail(5343784,"5455","Snowdon Range from Porthmadoc","DSC_0116_thumb.jpg",130,86,1);thumbnails[5343837]=new thumbnail(5343837,"5455","ST Davids Cathedral ,St Davids, Pembrokeshire","DSC_0852_thumb.jpg",130,195,1);thumbnails[5343867]=new thumbnail(5343867,"5455","Summertime, Pembrokeshire","2009_06_01_0162-2_thumb.jpg",130,194,1);thumbnails[5355841]=new thumbnail(5355841,"5455","Whitesand Bay Pembrokeshire","NBG__Pembs_06273_thumb.JPG",130,196,1);thumbnails[5356985]=new thumbnail(5356985,"5455","Hint of Storm,Morfa Dyffryn","DSC_0007_thumb.jpg",130,86,1);thumbnails[5356989]=new thumbnail(5356989,"5455","Twilight, Tremadoc Bay","DSC_0093_thumb.jpg",130,78,1);thumbnails[5357012]=new thumbnail(5357012,"5455","Llangorse Lake & Brecon Beacons","DSC_0045-1_thumb.jpg",130,86,1);thumbnails[5357029]=new thumbnail(5357029,"5455","Ramsey Island & Whitesand Bay","DSC_1016_thumb.JPG",130,86,1);thumbnails[5357033]=new thumbnail(5357033,"5455","Llantony Abbey , Gospel Pass","DSC_0176_thumb.jpg",130,87,1);thumbnails[5357044]=new thumbnail(5357044,"5455","Tranquility, Brecon Canal.","_DSC0289_thumb.jpg",130,194,1);thumbnails[5357052]=new thumbnail(5357052,"5455","Doing Your Own Thing, Brecon Canal","_DSC0327_thumb.jpg",130,87,1);thumbnails[5357060]=new thumbnail(5357060,"5455","End of Day nr St Davids","DSC_1038_thumb.jpg",130,194,1);thumbnails[5357071]=new thumbnail(5357071,"5455","Autumn, Castell Coch nr Cardiff","DSC_1163_thumb.jpg",130,194,1);thumbnails[5357075]=new thumbnail(5357075,"5455","Nant Ffrancon, Storm Ahead","DSC_1245_thumb.jpg",130,87,1);thumbnails[5357097]=new thumbnail(5357097,"5455","Strumble Head, Pembrokeshire","image-4_thumb.jpg",130,88,1);thumbnails[5357100]=new thumbnail(5357100,"5455","Cader Idris in Mist","DSC_1552_thumb.jpg",130,87,1);thumbnails[93752]=new thumbnail(93752,"5455","Bluebell Time Wenallt Cardiff","Bluebells,Wenallt ,Cardiff No2_thumb.jpg",130,198,1);thumbnails[94047]=new thumbnail(94047,"5455","Wales Millenium Centre, Cardiff bay","Wales Millenium Centre_thumb.jpg",130,86,1);thumbnails[159757]=new thumbnail(159757,"298095","Stones of Wales","Stones of Wales_thumb.jpg",130,197,1);thumbnails[5299528]=new thumbnail(5299528,"298095","Sand Pattern Mawddach Estuary","DSC_0060_thumb.JPG",130,87,1);thumbnails[5299658]=new thumbnail(5299658,"298095","Rock Sculpture","DSC_0192_thumb.JPG",130,177,1);thumbnails[5299713]=new thumbnail(5299713,"298095","Sand Pattern Whitesand Bay","DSC_1168_thumb.JPG",130,191,1);thumbnails[5310082]=new thumbnail(5310082,"298095","Sea & Sand Merging","2009_06_01_0158-1_thumb.jpg",130,87,1);thumbnails[5310111]=new thumbnail(5310111,"298095","Sand Rythyms","2009_06_12_00171_thumb.jpg",130,87,1);thumbnails[2015677]=new thumbnail(2015677,"133457","Lovers' Chat","DSC_0536_thumb.JPG",130,195,1);thumbnails[2019969]=new thumbnail(2019969,"133457","Pierhead Building & Merchant Marine Memorial","DSC_0046_thumb.JPG",130,170,1);thumbnails[2019971]=new thumbnail(2019971,"133457","Pierhead Building, Sennedd & Wales Millennium Centre","DSC_0011_thumb.JPG",130,93,1);thumbnails[2022039]=new thumbnail(2022039,"133457","Miner Figure in Cardiff Bay","DSC_0023_thumb.JPG",130,195,1);thumbnails[2022078]=new thumbnail(2022078,"133457","Look see!","DSC_0054_thumb.JPG",130,190,1);thumbnails[2022086]=new thumbnail(2022086,"133457","Pierhead Building Framed","DSC_0041_thumb.JPG",130,195,1);thumbnails[2022091]=new thumbnail(2022091,"133457","Millennium Centre Reflection","DSC_0540_thumb.JPG",130,195,1);thumbnails[2022102]=new thumbnail(2022102,"133457","Wales Millennium Centre","DSC_0542_thumb.JPG",130,90,1);thumbnails[2022110]=new thumbnail(2022110,"133457","Reflection 2","DSC_0016_thumb.JPG",130,87,1);thumbnails[2022117]=new thumbnail(2022117,"133457","Norwegian Church","DSC_0018_thumb.JPG",130,181,1);thumbnails[2022120]=new thumbnail(2022120,"133457","Scott Memorial","DSC_0020_thumb.JPG",130,183,1);thumbnails[159759]=new thumbnail(159759,"299891","Snowdrop","Snowdrop1_thumb.jpg",130,203,1);thumbnails[159841]=new thumbnail(159841,"299891","Tulips after Rain","Tulips After Rain1_thumb.jpg",130,211,1);thumbnails[1187645]=new thumbnail(1187645,"299891","Poppies","LIONS 08-08-2006 14-44-29_thumb.jpg",130,87,1);thumbnails[5327981]=new thumbnail(5327981,"299891","Daffodils..the flower of Wales","DSC_0004_thumb.JPG",130,86,1);thumbnails[5327986]=new thumbnail(5327986,"299891","A Pile of Daisies!","DSC_0005_FF0F3545-2219-B5B5-4C3382EF4EE69896_thumb.JPG",130,196,1);thumbnails[5327996]=new thumbnail(5327996,"299891","Sweet pea ....the darling of August!","DSC_0134_thumb.JPG",130,87,1);thumbnails[5328009]=new thumbnail(5328009,"299891","Rose..a message? Maybe, maybe not?","DSC_1911_thumb.JPG",130,87,1);thumbnails[82830]=new thumbnail(82830,"299891","Bluebell","Bluebell_thumb.jpg",130,90,1);var galleries=new Object();galleries[5455]=new gallery(5455,"5357100,5357097,5357075,5357071,5357060,5357052,5357044,5357033,5357029,5357012","CLASSIC VIEWS","gallery",[1263308,5299627,5299660,5299669,5299677,5328593,5342798,5342873,5343136,5343161,5343162,5343168,5343169,5343173,5343367,5343406,5343638,5343680,5343784,5343837,5343867,5355841,5356985,5356989,5357012,5357029,5357033,5357044,5357052,5357060,5357071,5357075,5357097,5357100,93752,94047]);galleries[298095]=new gallery(298095,"5310111,5310082,5299713,5299658,5299528,159757","ABSTRACT IMAGES","gallery",[159757,5299528,5299658,5299713,5310082,5310111]);galleries[133457]=new gallery(133457,"2022120,2022117,2022110,2022102,2022091,2022086,2022078,2022039,2019971,2019969","Cardiff Bay","gallery",[2015677,2019969,2019971,2022039,2022078,2022086,2022091,2022102,2022110,2022117,2022120]);galleries[299891]=new gallery(299891,"5328009,5327996,5327986,5327981,1187645,159841,159759,82830","Flowers of Wales","gallery",[159759,159841,1187645,5327981,5327986,5327996,5328009,82830]);var imageSets=new Object();imageSets[1]="1187645";imageSets[3]="5357100,5357097,5357075,5357071,5357060,5357052,5357044,5357033,5357029,5357012,5356989,5356985,5355841,5343867,5343837,5343784,5343680,5343638,5343406,5343367,5343173,5343169,5343168,5343162,5343161,5343136,5342873,5342798,5328593,5328009,5327996,5327986,5327981,5310111,5310082,5299713,5299677,5299669,5299660,5299658,5299627,5299528,2022120,2022117,2022110,2022102,2022091,2022086,2022078,2022039";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/deswds/images";break}switch(a){case 1:b="http://www1.clikpic.com/deswds/images";break}switch(a){case 2:b="http://admin.clikpic.com/deswds/images";break}switch(a){case 24:b="http://tpc15/clikpic/deswds/images";break}switch(a){case 4:b="http://www.clikchurch.com/deswds/images";break}switch(a){case 5:b="http://www2.clikpic.com/deswds/images";break}switch(a){case 22:b="http://tpc5/clikpic/deswds/images";break}switch(a){case 23:b="http://tpc10/clikpic/deswds/images";break}switch(a){case 25:b="http://tpc16/clikpic/deswds/images";break}switch(a){case 15:b="http://www3.clikpic.com/deswds/images";break}switch(a){case 18:b="http://www4.clikpic.com/deswds/images";break}switch(a){case 19:b="http://www5.clikpic.com/deswds/images";break}switch(a){case 31:b="http://www7.clikpic.com/deswds/images";break}switch(a){case 32:b="http://admin2.clikpic.com/deswds/images";break}switch(a){case 33:b="http://www8.clikpic.com/deswds/images";break}switch(a){case 34:b="http://www9.clikpic.com/deswds/images";break}switch(a){case 35:b="http://admin3.clikpic.com/deswds/images";break}switch(a){case 37:b="http://admin4.clikpic.com/deswds/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="'+escape(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="Telling the Beauty of 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="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="DESWDS">';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+'")'})}}};
