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[722783]=new thumbnail(722783,"56776","","web_thumb.jpg",130,87,1);thumbnails[723026]=new thumbnail(723026,"56776","","Dcs_1974 new1_thumb.jpg",130,55,1);thumbnails[734432]=new thumbnail(734432,"56811","","DSC_4277_thumb.jpg",130,98,1);thumbnails[734434]=new thumbnail(734434,"56776","","_DSC2448 SP2_thumb.jpg",130,76,1);thumbnails[735051]=new thumbnail(735051,"56776","","web 2_thumb.jpg",130,87,1);thumbnails[735908]=new thumbnail(735908,"56811","","DSC_4651_thumb.jpg",130,86,1);thumbnails[735910]=new thumbnail(735910,"56811","","DSC_1175_thumb.jpg",130,86,1);thumbnails[735919]=new thumbnail(735919,"56811","","DSC_1911_thumb.jpg",130,86,1);thumbnails[735923]=new thumbnail(735923,"56811","","DSC_2030_thumb.jpg",130,86,1);thumbnails[736121]=new thumbnail(736121,"56776","","DSC_0465_thumb.jpg",130,72,1);thumbnails[736122]=new thumbnail(736122,"71424","","DSC_3048 Web_thumb.jpg",130,194,1);thumbnails[736141]=new thumbnail(736141,"56811","","Ruthin wall 8x12_thumb.jpg",130,87,1);thumbnails[736215]=new thumbnail(736215,"56811","","R1_thumb.jpg",130,95,1);thumbnails[736220]=new thumbnail(736220,"56811","","20x16 Karthen_thumb.jpg",130,86,1);thumbnails[782523]=new thumbnail(782523,"56811","","DSC_6960_thumb.jpg",130,104,1);thumbnails[782549]=new thumbnail(782549,"71424","","DSC_0465web_thumb.jpg",130,191,1);thumbnails[782564]=new thumbnail(782564,"56811","","DSC_7710_New_Web_thumb.jpg",130,77,1);thumbnails[782570]=new thumbnail(782570,"60689","","DSC_5600_thumb.jpg",130,176,1);thumbnails[943409]=new thumbnail(943409,"71424","","dres_thumb.jpg",130,190,1);thumbnails[943410]=new thumbnail(943410,"71424","","top_thumb.jpg",130,186,1);thumbnails[943471]=new thumbnail(943471,"56776","","aled 917_thumb.jpg",130,130,1);thumbnails[1198666]=new thumbnail(1198666,"","Aled Oldfield ","web_test_31_thumb.jpg",130,88,1);thumbnails[3568226]=new thumbnail(3568226,"71424","","DSC_0441_worked_on__Web_thumb.jpg",130,226,1);thumbnails[3602267]=new thumbnail(3602267,"71424","","web_1_thumb.jpg",130,67,1);thumbnails[3604683]=new thumbnail(3604683,"71424","","DSC_6472_worked_onBW_thumb.jpg",130,247,1);thumbnails[3604684]=new thumbnail(3604684,"71424","","DSC_6489_thumb.jpg",130,195,1);thumbnails[3669284]=new thumbnail(3669284,"71424","","DSC_6596_Blue_thumb.jpg",130,291,1);thumbnails[3874292]=new thumbnail(3874292,"71424","","Web_DSC_2551BL1_thumb.jpg",130,255,1);thumbnails[3874296]=new thumbnail(3874296,"71424","","Web_DSC_2568_thumb.jpg",130,130,1);thumbnails[3874298]=new thumbnail(3874298,"71424","","Web_DSC_2587_thumb.jpg",130,86,1);thumbnails[4418590]=new thumbnail(4418590,"56691","","DSC_6162a_thumb.jpg",130,195,1);thumbnails[4435743]=new thumbnail(4435743,"56691","Gemma and Philip Rhodes wedding on the 4th July 2009","DSC_1223_Web_thumb.jpg",130,163,1);thumbnails[5294079]=new thumbnail(5294079,"56691","","_DSC8018_thumb.JPG",130,86,1);thumbnails[5396039]=new thumbnail(5396039,"56691","Wedding photography","Wedding_Photography12_thumb.jpg",130,94,1);thumbnails[5624959]=new thumbnail(5624959,"60689","","DSC_5608_thumb.jpg",130,176,1);thumbnails[1989103]=new thumbnail(1989103,"56811","","P3_thumb.jpg",130,86,1);thumbnails[782559]=new thumbnail(782559,"56811","","DSC_6449_thumb.jpg",130,130,1);thumbnails[782560]=new thumbnail(782560,"71424","","DSC_0676_Make up for web_thumb.jpg",130,130,1);thumbnails[943553]=new thumbnail(943553,"56776","","DSC_7128_thumb.jpg",130,69,1);thumbnails[1988215]=new thumbnail(1988215,"56776","","Studio 13x20_thumb.jpg",130,74,1);thumbnails[1988219]=new thumbnail(1988219,"56776","","DSC_3608_thumb.jpg",130,91,1);thumbnails[1989582]=new thumbnail(1989582,"71424","","Marcher 2_thumb.jpg",130,60,1);thumbnails[782573]=new thumbnail(782573,"71424","","DSC_2262BW_thumb.jpg",130,87,1);thumbnails[943408]=new thumbnail(943408,"56776","","Web Mother_thumb.jpg",130,66,1);thumbnails[1988218]=new thumbnail(1988218,"56776","","DSC_3591_thumb.jpg",130,73,1);thumbnails[735905]=new thumbnail(735905,"56776","","Gril_thumb.jpg",130,163,1);thumbnails[736126]=new thumbnail(736126,"56776","","aled portrait_thumb.jpg",130,130,1);thumbnails[736134]=new thumbnail(736134,"56776","","DSC_03652_thumb.jpg",130,183,1);thumbnails[3401649]=new thumbnail(3401649,"56811","","DSC_9402_thumb.jpg",130,104,1);thumbnails[3458499]=new thumbnail(3458499,"56811","","New DSC_7836_thumb.jpg",130,130,1);thumbnails[3401663]=new thumbnail(3401663,"56811","","DSC_5418_thumb.jpg",130,70,1);thumbnails[722774]=new thumbnail(722774,"56811","","Bride and groom photographic at st davids park flintshire_thumb.jpg",130,152,1);thumbnails[738199]=new thumbnail(738199,"56811","","22x18  2_thumb.jpg",130,196,1);thumbnails[752603]=new thumbnail(752603,"56811","","DSC_5067_thumb.BW.jpg",130,163,1);thumbnails[752562]=new thumbnail(752562,"56811","","DSC_1790_thumb.jpg",130,195,1);thumbnails[782577]=new thumbnail(782577,"56811","","DSC_6378SP_thumb.jpg",130,212,1);thumbnails[6519796]=new thumbnail(6519796,"56811","","DSC_6421_thumb.jpg",130,196,1);thumbnails[4255701]=new thumbnail(4255701,"56811","","DSC_8051_thumb.jpg",130,229,1);thumbnails[735926]=new thumbnail(735926,"56811","","Bride_1_thumb.jpg",130,196,1);thumbnails[3401647]=new thumbnail(3401647,"56811","","Bride_2_thumb.jpg",130,195,1);thumbnails[3401648]=new thumbnail(3401648,"56811","","DSC_9399_thumb.jpg",130,186,1);thumbnails[4183392]=new thumbnail(4183392,"11633","","Web_Wedding_thumb.jpg",130,86,1);thumbnails[4740393]=new thumbnail(4740393,"11633","","DSC_8351New_2_thumb.jpg",130,86,1);thumbnails[5112496]=new thumbnail(5112496,"11633","","DSC_6018_for_web_thumb.jpg",130,104,1);thumbnails[724866]=new thumbnail(724866,"11633","","DSC_8459_thumb.jpg",130,86,1);thumbnails[738193]=new thumbnail(738193,"11633","","DSC_7814WBB_thumb.jpg",130,86,1);thumbnails[738701]=new thumbnail(738701,"11633","","aled 1_thumb.jpg",130,91,1);thumbnails[722777]=new thumbnail(722777,"11633","","For The Web Site_thumb.jpg",130,130,1);thumbnails[723029]=new thumbnail(723029,"11633","","Untitled-1_thumb.jpg",130,107,1);thumbnails[3458497]=new thumbnail(3458497,"11633","","New DSC_9614_thumb.jpg",130,87,1);thumbnails[3458495]=new thumbnail(3458495,"11633","","New DSC_0261_thumb.jpg",130,87,1);thumbnails[752599]=new thumbnail(752599,"11633","","New 20x24_thumb.jpg",130,195,1);thumbnails[738196]=new thumbnail(738196,"11633","","DSC_3685 For Web_thumb.jpg",130,194,1);thumbnails[3458483]=new thumbnail(3458483,"11633","","DSC_6023_thumb.jpg",130,216,1);thumbnails[722770]=new thumbnail(722770,"11633","","DSC_8551_thumb.jpg",130,204,1);thumbnails[734430]=new thumbnail(734430,"11633","","Groom_thumb.jpg",130,196,1);thumbnails[4690396]=new thumbnail(4690396,"11633","","_DSC2138_Web_thumb.jpg",130,174,1);thumbnails[722778]=new thumbnail(722778,"11633","","DSC_8530_thumb.jpg",130,195,1);thumbnails[722779]=new thumbnail(722779,"11633","","20x16 D_thumb.jpg",130,199,1);thumbnails[686766]=new thumbnail(686766,"11633","","for the web_thumb.jpg",130,194,1);thumbnails[4222881]=new thumbnail(4222881,"11633","","Wedding_1_thumb.jpg",130,195,1);var galleries=new Object();galleries[56776]=new gallery(56776,"1988219,1988218,1988215,943553,943471,943408,736134,736126,736121,735905"," See More Family Portraits Click Here","section83033",[722783,723026,734434,735051,736121,943471,943553,1988215,1988219,943408,1988218,735905,736126,736134]);galleries[60689]=new gallery(60689,"5624959,782570","School Proms and Black Tie","section88364",[782570,5624959]);galleries[71424]=new gallery(71424,"943409","See More Photographs","section83033",[736122,782549,943409,943410,3568226,3602267,3604683,3604684,3669284,3874292,3874296,3874298,782560,1989582,782573]);galleries[56691]=new gallery(56691,"5396039,5294079,4435743,4418590","The Wedding Day ","section82948",[4418590,4435743,5294079,5396039]);galleries[56811]=new gallery(56811,"736220","wedding 2","section83069",[734432,735908,735910,735919,735923,736141,736215,736220,782523,782564,1989103,782559,3401649,3458499,3401663,722774,738199,752603,752562,782577,6519796,4255701,735926,3401647,3401648]);galleries[11633]=new gallery(11633,"738193","Wedding 1","gallery",[4183392,4740393,5112496,724866,738193,738701,722777,723029,3458497,3458495,752599,738196,3458483,722770,734430,4690396,722778,722779,686766,4222881]);var imageSets=new Object();imageSets[1]="1198666";imageSets[2]="943409,738193,736220";imageSets[3]="6519796,5624959,5396039,5294079,5112496,4740393,4690396,4435743,4418590,4255701,4222881,4183392,3874298,3874296,3874292,3669284,3604684,3604683,3602267,3568226,3458499,3458497,3458495,3458483,3401663,3401649,3401648,3401647,1989582,1989103,1988219,1988218,1988215,1198666,943553,943471,943410,943409,943408,782577,782573,782570,782564,782560,782559,782549,782523,752603,752599,752562";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/aled/images";break}switch(a){case 1:b="http://www1.clikpic.com/aled/images";break}switch(a){case 2:b="http://admin.clikpic.com/aled/images";break}switch(a){case 24:b="http://tpc15/clikpic/aled/images";break}switch(a){case 4:b="http://www.clikchurch.com/aled/images";break}switch(a){case 5:b="http://www2.clikpic.com/aled/images";break}switch(a){case 22:b="http://tpc5/clikpic/aled/images";break}switch(a){case 23:b="http://tpc10/clikpic/aled/images";break}switch(a){case 25:b="http://tpc16/clikpic/aled/images";break}switch(a){case 15:b="http://www3.clikpic.com/aled/images";break}switch(a){case 18:b="http://www4.clikpic.com/aled/images";break}switch(a){case 19:b="http://www5.clikpic.com/aled/images";break}switch(a){case 31:b="http://www7.clikpic.com/aled/images";break}switch(a){case 32:b="http://admin2.clikpic.com/aled/images";break}switch(a){case 33:b="http://www8.clikpic.com/aled/images";break}switch(a){case 34:b="http://www9.clikpic.com/aled/images";break}switch(a){case 35:b="http://admin3.clikpic.com/aled/images";break}switch(a){case 37:b="http://admin4.clikpic.com/aled/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="Aled Oldfield Photography: "+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+'")'})}}};