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[249479]=new thumbnail(249479,"22633","Calm before the storm","_DSC00162_thumb.jpg",130,93,1);thumbnails[249481]=new thumbnail(249481,"22633","Waterfall","_DSC00693_thumb.jpg",130,86,1);thumbnails[249483]=new thumbnail(249483,"22633","Brecon mountain steam railway","_DSC00753_thumb.jpg",130,84,1);thumbnails[249485]=new thumbnail(249485,"22633","Ponsticill reservoir","_DSC00841_thumb.jpg",130,86,1);thumbnails[249486]=new thumbnail(249486,"22633","Llangorse Lake 1","_MG_0884_thumb.jpg",130,87,1);thumbnails[249489]=new thumbnail(249489,"22630","ancient coast","_MG_8243_thumb.jpg",130,85,1);thumbnails[249490]=new thumbnail(249490,"22630","Dunraven bay looking west","_MG_8317-copy_thumb.jpg",130,87,1);thumbnails[249492]=new thumbnail(249492,"22630","Dunraven bay high tide","_MG_8351_thumb.jpg",130,85,1);thumbnails[249499]=new thumbnail(249499,"22630","Dunraven bay low tide","_MG_8610_thumb.jpg",130,202,1);thumbnails[249500]=new thumbnail(249500,"22630","Dunraven bay silky water","nice_thumb.jpg",130,86,1);thumbnails[249501]=new thumbnail(249501,"22630","Dunraven bay splash","splash_thumb.jpg",130,86,1);thumbnails[249502]=new thumbnail(249502,"22630","Dunraven bay disappearing sun","sunset_thumb.jpg",130,86,1);thumbnails[249505]=new thumbnail(249505,"22630","dunraven bay incoming tide","Untitled1_thumb.jpg",130,86,1);thumbnails[249506]=new thumbnail(249506,"22635","Oval basin At Dawn","DSC_00211_thumb.jpg",130,86,1);thumbnails[249507]=new thumbnail(249507,"22635","Wales milleniun centre","DSC_00271_thumb.jpg",130,86,1);thumbnails[249513]=new thumbnail(249513,"22635","Cardiff Bay yacht club","DSC_01301_thumb.jpg",130,195,1);thumbnails[249515]=new thumbnail(249515,"22635","Llandaff Cathedral","first-outing-with-nikon-1741_thumb.jpg",130,195,1);thumbnails[249517]=new thumbnail(249517,"22632","St Davids sunset","St-Davids05-1441_thumb.jpg",130,86,1);thumbnails[249520]=new thumbnail(249520,"22631","Penarth pier at dawn 2","DSC_00263_thumb.jpg",130,86,1);thumbnails[249521]=new thumbnail(249521,"22631","Penarth pier at dawn 1","DSC_00351_thumb.jpg",130,86,1);thumbnails[249523]=new thumbnail(249523,"22631","Storm over the pier","The-Pier_thumb.jpg",130,86,1);thumbnails[249525]=new thumbnail(249525,"22634","Sunset at the Second Severn Bridge ","severn-bridge-080_thumb.jpg",130,86,1);thumbnails[341215]=new thumbnail(341215,"22634","Looking to Wales","high-res-version_thumb.jpg",130,86,1);thumbnails[341337]=new thumbnail(341337,"28600","Longboat key sunset.","photobox-linda_thumb.jpg",130,87,1);thumbnails[341338]=new thumbnail(341338,"28600","Playtime at Longboat Key.","_MG_8991_thumb.jpg",130,87,1);thumbnails[341370]=new thumbnail(341370,"28600","Dusk at Longboat Key.","_MG_9232_thumb.jpg",130,87,1);thumbnails[726940]=new thumbnail(726940,"22635","Roath Park Lake","_MG_0278_thumb.jpg",130,96,1);thumbnails[726962]=new thumbnail(726962,"22635","Roath Park Lake 2","_MG_0297_thumb.jpg",130,89,1);thumbnails[726967]=new thumbnail(726967,"22635","Roath Park Lake 3","_MG_0309_thumb.jpg",130,88,1);thumbnails[735545]=new thumbnail(735545,"22630","Dunraven Bay winter evening.","_MG_5526_thumb.jpg",130,87,1);thumbnails[735566]=new thumbnail(735566,"22630","Dunraven Bay, The Cobbles.","_MG_5530_thumb.jpg",130,195,1);thumbnails[735590]=new thumbnail(735590,"22630","Dunraven Bay, The Slipway.","_MG_5232_thumb.jpg",130,87,1);thumbnails[735605]=new thumbnail(735605,"22630","Dunraven Bay, The Rockpool.","_MG_0596_thumb.jpg",130,86,1);thumbnails[735621]=new thumbnail(735621,"22630","Dunraven Bay, The Sandbar.","_MG_0579_thumb.jpg",130,89,1);thumbnails[735640]=new thumbnail(735640,"22630","Dunraven Bay, Afternoon Sun.","_MG_0581_thumb.jpg",130,86,1);thumbnails[737872]=new thumbnail(737872,"56953","Jumping for joy","Rhoosepoint,aberthaw-177_thumb.jpg",130,86,1);thumbnails[1709031]=new thumbnail(1709031,"22633","Autumn Gold","Ystradfellte1_thumb.jpg",130,195,1);thumbnails[1713057]=new thumbnail(1713057,"22632","View over Marloes Peninsular.","IMG_1414_thumb.jpg",130,87,1);thumbnails[1713065]=new thumbnail(1713065,"22632","Looking to Skomer.","IMG_1429_thumb.jpg",130,87,1);thumbnails[1743303]=new thumbnail(1743303,"22630","Dunraven Bay-Evening sun","Evening-sun_thumb.jpg",130,87,1);thumbnails[1758701]=new thumbnail(1758701,"22633","Ystradfellte cascade","IMG_2718_thumb.jpg",130,195,1);thumbnails[1758710]=new thumbnail(1758710,"22633","Ysradfellte cascade 2","IMG_2715_thumb.jpg",130,195,1);thumbnails[1758848]=new thumbnail(1758848,"22633","Ystradfellte Islands in the stream","IMG_2764_thumb.jpg",130,87,1);thumbnails[1778076]=new thumbnail(1778076,"22630","A winters day-Dunraven Bay","IMG_1460_thumb.jpg",130,195,1);thumbnails[1778919]=new thumbnail(1778919,"22632","Whitesands beach St Davids","_MG_9661_thumb.jpg",130,87,1);thumbnails[1852298]=new thumbnail(1852298,"124644","","IMG_1941_thumb.jpg",130,203,1);thumbnails[1852302]=new thumbnail(1852302,"124644","","IMG_1942_thumb.jpg",130,87,1);thumbnails[1852384]=new thumbnail(1852384,"124646","","IMG_3017_thumb.jpg",130,87,1);thumbnails[1852386]=new thumbnail(1852386,"124646","","IMG_2949_thumb.jpg",130,195,1);thumbnails[5495658]=new thumbnail(5495658,"22632","Elegug Stacks.","Elegug-Stacks_thumb.jpg",130,195,1);thumbnails[5521026]=new thumbnail(5521026,"22635","Dawn over the bay","boats-cardiff-bay1_thumb.jpg",130,84,1);thumbnails[5521036]=new thumbnail(5521036,"56953","Proud to be Welsh","BreconJazz05-068_thumb.jpg",130,86,1);thumbnails[5521037]=new thumbnail(5521037,"22633","Brecon Canal 1","BreconJazz05-110_thumb.jpg",130,86,1);thumbnails[5521041]=new thumbnail(5521041,"22633","Brecon canal 2","BreconJazz05-114_thumb.jpg",130,86,1);thumbnails[5521043]=new thumbnail(5521043,"22633","Brecon canal 3","BreconJazz05_thumb.jpg",130,86,1);thumbnails[5521045]=new thumbnail(5521045,"22632","Fishing at St Davids","St-Davids05-170_thumb.jpg",130,86,1);thumbnails[5521048]=new thumbnail(5521048,"22632","Tenby 1","St-Davids05-299_thumb.jpg",130,86,1);thumbnails[5521050]=new thumbnail(5521050,"22632","Tenby 2","St-Davids05-300_thumb.jpg",130,86,1);thumbnails[5521051]=new thumbnail(5521051,"22632","Tenby lifeboat","St-Florence-050_thumb.jpg",130,195,1);thumbnails[5521061]=new thumbnail(5521061,"22632","Tenby lifeboat station","St-Davids05-304_thumb.jpg",130,86,1);thumbnails[5538623]=new thumbnail(5538623,"313860","Burano bridge","IMG_3317Burano_thumb.jpg",130,195,1);thumbnails[5538627]=new thumbnail(5538627,"313860","Cat in a boat 1","IMG_3358Burano_thumb.jpg",130,195,1);thumbnails[5538634]=new thumbnail(5538634,"313860","Cat in a boat 2","IMG_3370Burano_thumb.jpg",130,195,1);thumbnails[5538636]=new thumbnail(5538636,"313860","Hanging out the washing","IMG_3378Burano_thumb.jpg",130,87,1);thumbnails[5538644]=new thumbnail(5538644,"313860","Morning reflection","IMG_3383Burano_thumb.jpg",130,195,1);thumbnails[5538651]=new thumbnail(5538651,"313860","Edge of the lagoon","IMG_3390Burano_thumb.jpg",130,87,1);thumbnails[5538654]=new thumbnail(5538654,"313860","Morning stroll","IMG_3406Burano_thumb.jpg",130,195,1);thumbnails[5850618]=new thumbnail(5850618,"124646","","IMG_2927_thumb.jpg",130,195,1);thumbnails[5850736]=new thumbnail(5850736,"124646","Memories of Venice","IMG_2948_thumb.jpg",130,87,1);thumbnails[5852308]=new thumbnail(5852308,"124646","","IMG_2963_thumb.jpg",130,195,1);thumbnails[5852737]=new thumbnail(5852737,"124646","","IMG_2987_thumb.jpg",130,195,1);thumbnails[5852868]=new thumbnail(5852868,"124646","","IMG_2988_thumb.jpg",130,87,1);thumbnails[5852984]=new thumbnail(5852984,"124646","","IMG_2989_thumb.jpg",130,87,1);thumbnails[5853083]=new thumbnail(5853083,"124646","Mask of Venice","IMG_2992_thumb.jpg",130,195,1);thumbnails[5853143]=new thumbnail(5853143,"124646","Water reflections 1","IMG_3160_thumb.jpg",130,195,1);thumbnails[5853152]=new thumbnail(5853152,"124646","Water reflections 2","IMG_3157_thumb.jpg",130,87,1);thumbnails[5853183]=new thumbnail(5853183,"124646","Water reflections 3","IMG_3164_thumb.jpg",130,87,1);thumbnails[5853210]=new thumbnail(5853210,"124646","Water reflections 4","IMG_3169_thumb.jpg",130,87,1);thumbnails[5853275]=new thumbnail(5853275,"124646","The artist","IMG_3459_thumb.jpg",130,195,1);thumbnails[5906769]=new thumbnail(5906769,"22630","Traeth Mawr","IMG_0066_thumb.jpg",130,195,1);thumbnails[5907714]=new thumbnail(5907714,"22632","Summer flowers","IMG_1408_thumb.jpg",130,190,1);thumbnails[5907808]=new thumbnail(5907808,"22633","Under the water","IMG_2698_thumb.jpg",130,195,1);thumbnails[5907893]=new thumbnail(5907893,"22633","River of life","IMG_2746_thumb.jpg",130,195,1);var galleries=new Object();galleries[22633]=new gallery(22633,"5907893,5907808,5521043,5521041,5521037,1758848,1758710,1758701,1709031,249486","Brecon Beacons","gallery",[249479,249481,249483,249485,249486,1709031,1758701,1758710,1758848,5521037,5521041,5521043,5907808,5907893]);galleries[313860]=new gallery(313860,"5538654,5538651,5538644,5538636,5538634,5538627,5538623","Burano Island Venetian Lagoon","gallery",[5538623,5538627,5538634,5538636,5538644,5538651,5538654]);galleries[22635]=new gallery(22635,"5521026,726967,726962,726940,249515,249513,249507,249506","Cardiff","gallery",[249506,249507,249513,249515,726940,726962,726967,5521026]);galleries[28600]=new gallery(28600,"341370,341338,341337","Far away shores-Gulf of Mexico Coast.","gallery",[341337,341338,341370]);galleries[22632]=new gallery(22632,"5907714,5521061,5521051,5521050,5521048,5521045,5495658,1778919,1713065,1713057","Pembrokeshire","gallery",[249517,1713057,1713065,1778919,5495658,5521045,5521048,5521050,5521051,5521061,5907714]);galleries[22631]=new gallery(22631,"249523,249521,249520","Penarth","gallery",[249520,249521,249523]);galleries[56953]=new gallery(56953,"5521036,737872","People","gallery",[737872,5521036]);galleries[22634]=new gallery(22634,"341215,249525","Second Severn Bridge","gallery",[249525,341215]);galleries[124644]=new gallery(124644,"1852302,1852298","Tuscany","gallery",[1852298,1852302]);galleries[124646]=new gallery(124646,"5853275,5853210,5853183,5853152,5853143,5853083,5852984,5852868,5852737,5852308","Venice","gallery",[1852384,1852386,5850618,5850736,5852308,5852737,5852868,5852984,5853083,5853143,5853152,5853183,5853210,5853275]);galleries[22630]=new gallery(22630,"5906769,1778076,1743303,735640,735621,735605,735590,735566,735545,249505","Welsh Heritage coast","gallery",[249489,249490,249492,249499,249500,249501,249502,249505,735545,735566,735590,735605,735621,735640,1743303,1778076,5906769]);var imageSets=new Object();imageSets[1]="1852386,1852302,1852298,1778919,1778076,1758710,1743303";imageSets[3]="5907893,5907808,5907714,5906769,5853275,5853210,5853183,5853152,5853143,5853083,5852984,5852868,5852737,5852308,5850736,5850618,5538654,5538651,5538644,5538636,5538634,5538627,5538623,5521061,5521051,5521050,5521048,5521045,5521043,5521041,5521037,5521036,5521026,5495658,1852386,1852384,1852302,1852298,1778919,1778076,1758848,1758710,1758701,1743303,1713065,1713057,1709031,737872,735640,735621";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/moreau/images";break}switch(a){case 1:b="http://www1.clikpic.com/moreau/images";break}switch(a){case 2:b="http://admin.clikpic.com/moreau/images";break}switch(a){case 24:b="http://tpc15/clikpic/moreau/images";break}switch(a){case 4:b="http://www.clikchurch.com/moreau/images";break}switch(a){case 5:b="http://www2.clikpic.com/moreau/images";break}switch(a){case 22:b="http://tpc5/clikpic/moreau/images";break}switch(a){case 23:b="http://tpc10/clikpic/moreau/images";break}switch(a){case 25:b="http://tpc16/clikpic/moreau/images";break}switch(a){case 15:b="http://www3.clikpic.com/moreau/images";break}switch(a){case 18:b="http://www4.clikpic.com/moreau/images";break}switch(a){case 19:b="http://www5.clikpic.com/moreau/images";break}switch(a){case 31:b="http://www7.clikpic.com/moreau/images";break}switch(a){case 32:b="http://admin2.clikpic.com/moreau/images";break}switch(a){case 33:b="http://www8.clikpic.com/moreau/images";break}switch(a){case 34:b="http://www9.clikpic.com/moreau/images";break}switch(a){case 35:b="http://admin3.clikpic.com/moreau/images";break}switch(a){case 37:b="http://admin4.clikpic.com/moreau/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="Welsh Landscape .com: "+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> 							"+(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<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+'")'})}}};