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[3583261]=new thumbnail(3583261,"172914","Merthyr Mawr Church, Bridgend, South Wales","Harmony_thumb.jpg",130,99,5);thumbnails[2728599]=new thumbnail(2728599,"278610","The bride and groom","b&w-bride-and-groom2_thumb.jpg",130,98,5);thumbnails[2734963]=new thumbnail(2734963,"172913","","Laurynsitting_thumb.jpg",130,172,5);thumbnails[2734965]=new thumbnail(2734965,"172913","Sample of candid portraits","mad-kids_thumb.jpg",130,71,5);thumbnails[2735018]=new thumbnail(2735018,"172913","Portrait example","Liam_thumb.jpg",130,98,5);thumbnails[2735020]=new thumbnail(2735020,"172911","Sgwd Dwlli falls","Sgwd-Ddwlli_thumb.jpg",130,98,5);thumbnails[2744705]=new thumbnail(2744705,"172913","For Demo purpose only ","Laurynweb_thumb.jpg",130,98,5);thumbnails[2744710]=new thumbnail(2744710,"172913","For illustration purposes only","Liam@brianneweb_thumb.jpg",130,98,5);thumbnails[3273708]=new thumbnail(3273708,"172913","Another typical example of portrait work","3077573499_c32964de8f_thumb.jpg",130,173,5);thumbnails[3661290]=new thumbnail(3661290,"278610","Wedding photography example","P8030211_thumb.jpg",130,80,5);thumbnails[3912058]=new thumbnail(3912058,"172913","","Annabellejpgweb_thumb.jpg",130,184,5);thumbnails[4884598]=new thumbnail(4884598,"278614","Commercial portrait work","WB1-2_thumb.jpg",130,196,5);thumbnails[4884600]=new thumbnail(4884600,"172913","Portrait example","_DSC1718a_thumb.jpg",130,86,5);thumbnails[4884602]=new thumbnail(4884602,"278610","Wedding photography","_DSC6441_thumb.jpg",130,86,5);thumbnails[4884796]=new thumbnail(4884796,"278610","Wedding photography","_DSC6450_thumb.jpg",130,86,5);thumbnails[4884803]=new thumbnail(4884803,"172913","","_DSC3011edit_thumb.jpg",130,193,5);thumbnails[4884806]=new thumbnail(4884806,"172913","","_DSC1709_thumb.jpg",130,96,5);thumbnails[4884813]=new thumbnail(4884813,"172913","","_DSC8540a_thumb.jpg",130,193,5);thumbnails[4884816]=new thumbnail(4884816,"172913","","_DSC1244_thumb.jpg",130,86,5);thumbnails[4884818]=new thumbnail(4884818,"172913","","_DSC1258_thumb.jpg",130,86,5);thumbnails[4884825]=new thumbnail(4884825,"278610","","_DSC6338_thumb.jpg",130,85,5);thumbnails[4884828]=new thumbnail(4884828,"278610","","_DSC6131_thumb.jpg",130,86,5);thumbnails[4884829]=new thumbnail(4884829,"278610","","_DSC6598_thumb.jpg",130,196,5);thumbnails[4884830]=new thumbnail(4884830,"172913","","_DSC9301mono_thumb.jpg",130,97,5);thumbnails[4884836]=new thumbnail(4884836,"278610","","_DSC6366_thumb.jpg",130,86,5);thumbnails[4884839]=new thumbnail(4884839,"172913","","_DSC1346-2_thumb.jpg",130,86,5);thumbnails[4884840]=new thumbnail(4884840,"172913","","_DSC8540a1_thumb.jpg",130,193,5);thumbnails[4884847]=new thumbnail(4884847,"278610","","_DSC6396_thumb.jpg",130,86,5);thumbnails[4884851]=new thumbnail(4884851,"278610","","_DSC6415_thumb.jpg",130,48,5);thumbnails[4884854]=new thumbnail(4884854,"278610","","_DSC6421_thumb.jpg",130,86,5);thumbnails[4885160]=new thumbnail(4885160,"172913","","_DSC1355_thumb.jpg",130,86,5);thumbnails[4885171]=new thumbnail(4885171,"172911","","_DSC0012_thumb.jpg",130,97,5);thumbnails[4885174]=new thumbnail(4885174,"172911","","_DSC0019_thumb.jpg",130,210,5);thumbnails[4885175]=new thumbnail(4885175,"172914","","_DSC0571_thumb.jpg",130,95,5);thumbnails[4885180]=new thumbnail(4885180,"278614","","_DSC1057_thumb.jpg",130,86,5);thumbnails[4885182]=new thumbnail(4885182,"278614","","_DSC1060_thumb.jpg",130,86,5);thumbnails[4885189]=new thumbnail(4885189,"278614","","_DSC1061_thumb.jpg",130,86,5);thumbnails[4885191]=new thumbnail(4885191,"278614","","_DSC1074_thumb.jpg",130,68,5);thumbnails[4885196]=new thumbnail(4885196,"278614","","_DSC1080mono_thumb.jpg",130,69,5);thumbnails[4885197]=new thumbnail(4885197,"172913","","_DSC1241_thumb.jpg",130,207,5);thumbnails[4886015]=new thumbnail(4886015,"172913","","_DSC1365_thumb.jpg",130,86,5);thumbnails[4886017]=new thumbnail(4886017,"172913","","_DSC1373_thumb.jpg",130,94,5);thumbnails[4886028]=new thumbnail(4886028,"172911","","_DSC1435_thumb.jpg",130,208,5);thumbnails[4886031]=new thumbnail(4886031,"172911","","_DSC3778_thumb.jpg",130,87,5);thumbnails[4886032]=new thumbnail(4886032,"172911","","_DSC3869_thumb.jpg",130,108,5);thumbnails[4886041]=new thumbnail(4886041,"172911","","_DSC3880_thumb.jpg",130,120,5);thumbnails[4886047]=new thumbnail(4886047,"172911","","_DSC3966_thumb.jpg",130,87,5);thumbnails[4893962]=new thumbnail(4893962,"278610","","_DSC6199_thumb.jpg",130,196,5);thumbnails[4893965]=new thumbnail(4893965,"278610","","_DSC6440_thumb.jpg",130,196,5);thumbnails[4893968]=new thumbnail(4893968,"172911","","_DSC4221_thumb.jpg",130,72,5);thumbnails[4893974]=new thumbnail(4893974,"172913","","_DSC7447_thumb.jpg",130,86,5);thumbnails[4893976]=new thumbnail(4893976,"172911","","_DSC7771_thumb.jpg",130,99,5);thumbnails[4893981]=new thumbnail(4893981,"172913","","EOS_12627_thumb.jpg",130,81,5);thumbnails[4893989]=new thumbnail(4893989,"172913","","highkey-angela_thumb.jpg",130,87,5);thumbnails[4894114]=new thumbnail(4894114,"172911","","Sinking-sun_thumb.jpg",130,101,5);thumbnails[4894119]=new thumbnail(4894119,"172911","","Kenfig-Tree_thumb.jpg",130,85,5);thumbnails[4894123]=new thumbnail(4894123,"172914","","the-rail_thumb.jpg",130,87,5);thumbnails[4894129]=new thumbnail(4894129,"172914","","_DSC9320_thumb.jpg",130,182,5);thumbnails[4918673]=new thumbnail(4918673,"172911","","DSC_0048_thumb.jpg",130,196,5);thumbnails[4918675]=new thumbnail(4918675,"172911","","_DSC8704_thumb.jpg",130,203,5);thumbnails[4918685]=new thumbnail(4918685,"172911","","Forgotten-Falls_thumb.jpg",130,206,5);thumbnails[4918686]=new thumbnail(4918686,"172911","","2And2more1_thumb.jpg",130,87,5);thumbnails[4918687]=new thumbnail(4918687,"172911","","_DSC8726_thumb.jpg",130,86,5);thumbnails[4918689]=new thumbnail(4918689,"172911","","ice_thumb.jpg",130,173,5);thumbnails[4918765]=new thumbnail(4918765,"172911","","DSC_0058-3_thumb.jpg",130,87,5);thumbnails[4918766]=new thumbnail(4918766,"172913","","_DSC6980small_thumb.jpg",130,86,5);thumbnails[5816978]=new thumbnail(5816978,"172911","Groyne","_DSC4030_thumb.jpg",130,87,5);thumbnails[6311694]=new thumbnail(6311694,"278610","","DCT_119_thumb.jpg",130,185,5);var galleries=new Object();galleries[172914]=new gallery(172914,"4894129,4894123,4885175,3583261","Architecture","section216014",[3583261,4885175,4894123,4894129]);galleries[278614]=new gallery(278614,"4885196,4885191,4885189,4885182,4885180,4884598","Commercial work","section216014",[4884598,4885180,4885182,4885189,4885191,4885196]);galleries[172911]=new gallery(172911,"5816978,4918765,4918689,4918687,4918686,4918685,4918675,4918673,4894119,4894114","Landscapes","section216014",[2735020,4885171,4885174,4886028,4886031,4886032,4886041,4886047,4893968,4893976,4894114,4894119,4918673,4918675,4918685,4918686,4918687,4918689,4918765,5816978]);galleries[172913]=new gallery(172913,"3912058","Portraits","section216014",[2734963,2734965,2735018,2744705,2744710,3273708,3912058,4884600,4884803,4884806,4884813,4884816,4884818,4884830,4884839,4884840,4885160,4885197,4886015,4886017,4893974,4893981,4893989,4918766]);galleries[278610]=new gallery(278610,"6311694,4893965,4893962,4884854,4884851,4884847,4884836,4884829,4884828,4884825","Wedding photography","section216014",[2728599,3661290,4884602,4884796,4884825,4884828,4884829,4884836,4884847,4884851,4884854,4893962,4893965,6311694]);var imageSets=new Object();imageSets[1]="5816978,4918766,4918765,4918687,4918685,4918675,4894129,4894123,4894119,4894114,4893989,4893981,4893976,4893974,4893968,4893962,4886031,4886028,4885175,4885174,4885171,4884854,4884830,4884600";imageSets[2]="3912058";imageSets[3]="4918689,4918686,4918673,4893965,4886047,4886041,4886032,4886017,4886015,4885197,4885196,4885191,4885189,4885182,4885180,4885160,4884851,4884847,4884840,4884839,4884836,4884829,4884828,4884825,4884818,4884816,4884813";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/leightonroberts/images";break}switch(a){case 1:b="http://www1.clikpic.com/leightonroberts/images";break}switch(a){case 2:b="http://admin.clikpic.com/leightonroberts/images";break}switch(a){case 24:b="http://tpc15/clikpic/leightonroberts/images";break}switch(a){case 4:b="http://www.clikchurch.com/leightonroberts/images";break}switch(a){case 5:b="http://www2.clikpic.com/leightonroberts/images";break}switch(a){case 22:b="http://tpc5/clikpic/leightonroberts/images";break}switch(a){case 23:b="http://tpc10/clikpic/leightonroberts/images";break}switch(a){case 25:b="http://tpc16/clikpic/leightonroberts/images";break}switch(a){case 15:b="http://www3.clikpic.com/leightonroberts/images";break}switch(a){case 18:b="http://www4.clikpic.com/leightonroberts/images";break}switch(a){case 19:b="http://www5.clikpic.com/leightonroberts/images";break}switch(a){case 31:b="http://www7.clikpic.com/leightonroberts/images";break}switch(a){case 32:b="http://admin2.clikpic.com/leightonroberts/images";break}switch(a){case 33:b="http://www8.clikpic.com/leightonroberts/images";break}switch(a){case 34:b="http://www9.clikpic.com/leightonroberts/images";break}switch(a){case 35:b="http://admin3.clikpic.com/leightonroberts/images";break}switch(a){case 37:b="http://admin4.clikpic.com/leightonroberts/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("section216014"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section216014.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("section216014"!=""){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="Life through my lens: "+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="LEIGHTONROBERTS">';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+'")'})}}};