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[1666580]=new thumbnail(1666580,"","Blue Tit","Blue-Tit_thumb.jpg",130,90,18);thumbnails[1666643]=new thumbnail(1666643,"","Greylag Goose 3","3W6B9880_thumb.jpg",130,97,18);thumbnails[1668687]=new thumbnail(1668687,"","Hadleigh Castle","Castle-3_thumb.jpg",130,184,18);thumbnails[1668691]=new thumbnail(1668691,"","Sunset over the Thames","Places_thumb.005JPG.jpg",130,65,18);thumbnails[1759532]=new thumbnail(1759532,"","Blue Tit","CAO_thumb.WP-0125a.jpg",130,88,18);thumbnails[2410107]=new thumbnail(2410107,"","","CAO_thumb.WP-02391.jpg",130,193,18);thumbnails[1668786]=new thumbnail(1668786,"178819","Waiting","Image-2_thumb.jpg",130,96,18);thumbnails[1672361]=new thumbnail(1672361,"178819","Posy","Image-1_thumb.jpg",130,177,18);thumbnails[2881075]=new thumbnail(2881075,"178819","","030_thumb.jpg",130,86,18);thumbnails[2881118]=new thumbnail(2881118,"178819","","057_thumb.jpg",130,104,18);thumbnails[2881123]=new thumbnail(2881123,"178819","","068_thumb.jpg",130,99,18);thumbnails[2881126]=new thumbnail(2881126,"178819","","082_thumb.jpg",130,103,18);thumbnails[2912048]=new thumbnail(2912048,"178819","","0901_thumb.jpg",130,174,18);thumbnails[2912082]=new thumbnail(2912082,"178819","","034a_thumb.jpg",130,86,18);thumbnails[2912095]=new thumbnail(2912095,"178819","","012a1_thumb.jpg",130,165,18);thumbnails[2406255]=new thumbnail(2406255,"155833","","3W6B93131_thumb.JPG",130,90,18);thumbnails[2406261]=new thumbnail(2406261,"155833","","3W6B93841_thumb.JPG",130,85,18);thumbnails[2406264]=new thumbnail(2406264,"155833","","3W6B93881_thumb.JPG",130,84,18);thumbnails[2406265]=new thumbnail(2406265,"155833","","3W6B93942_thumb.JPG",130,87,18);thumbnails[2406268]=new thumbnail(2406268,"155833","","3W6B95201_thumb.JPG",130,85,18);thumbnails[4307675]=new thumbnail(4307675,"155833","","CAO-282_thumb.jpg",130,196,18);thumbnails[4307683]=new thumbnail(4307683,"155833","","CAO-39_final_thumb.jpg",130,85,18);thumbnails[4309903]=new thumbnail(4309903,"155833","","3W6B1937_thumb.jpg",130,87,18);thumbnails[2406027]=new thumbnail(2406027,"155838","","0001 127_thumb.jpg",130,96,18);thumbnails[2406202]=new thumbnail(2406202,"155838","","0001 156_thumb.jpg",130,105,18);thumbnails[2406203]=new thumbnail(2406203,"155838","","0001 186_thumb.jpg",130,136,18);thumbnails[2406270]=new thumbnail(2406270,"155838","","CAO-8Dip_thumb.jpg",130,158,18);thumbnails[2406271]=new thumbnail(2406271,"155838","","CAO-10Dip1_thumb.jpg",130,92,18);thumbnails[2406272]=new thumbnail(2406272,"155838","","CAO-11Dip1_thumb.jpg",130,93,18);thumbnails[2406273]=new thumbnail(2406273,"155838","","CAO-12Dip1_thumb.jpg",130,93,18);thumbnails[1668788]=new thumbnail(1668788,"112602","Mother & Daughter","013_126_thumb.01.jpg",130,89,18);thumbnails[1668790]=new thumbnail(1668790,"112602","Sisters","DPP_0011a_thumb.jpg",130,109,18);thumbnails[1672363]=new thumbnail(1672363,"112602","Mother and Daughter 2","013_114_thumb.02.jpg",130,187,18);thumbnails[1672366]=new thumbnail(1672366,"112602","Sisters 2","DPP_0023a_thumb.jpg",130,94,18);thumbnails[1672367]=new thumbnail(1672367,"112602","Fun","DPP_0067a_thumb.jpg",130,93,18);thumbnails[2406293]=new thumbnail(2406293,"112602","","CAO-80 final_thumb.jpg",130,194,18);thumbnails[4307693]=new thumbnail(4307693,"112602","","NG-CO-004_thumb.jpg",130,182,18);thumbnails[4307695]=new thumbnail(4307695,"112602","","NG-CO-014_thumb.jpg",130,202,18);thumbnails[4307707]=new thumbnail(4307707,"112602","","NG-CO-029a_thumb.jpg",130,208,18);thumbnails[4307721]=new thumbnail(4307721,"112602","","NG-CO-034_thumb.jpg",130,103,18);thumbnails[4307732]=new thumbnail(4307732,"112602","","NG-CO-051_thumb.jpg",130,164,18);thumbnails[4307735]=new thumbnail(4307735,"112602","","NG-CO-061_thumb.jpg",130,195,18);thumbnails[4307741]=new thumbnail(4307741,"112602","","NG-CO-064_thumb.jpg",130,184,18);thumbnails[1663277]=new thumbnail(1663277,"178824","Long Tailed Tit","Long Tailed Tit_thumb.jpg",130,84,18);thumbnails[1666616]=new thumbnail(1666616,"178824","Roe Deer","Roe Deer+_thumb.jpg",130,147,18);thumbnails[1666620]=new thumbnail(1666620,"178824","Greylag Goose 1","3W6B9882_thumb.jpg",130,88,18);thumbnails[1666660]=new thumbnail(1666660,"178824","Black Tailed Skimmer","Black-Tailed-Skimmer_thumb.jpg",130,90,18);thumbnails[1759531]=new thumbnail(1759531,"178824","Female Kestrel","CAO_thumb.WP-0109a1.jpg",130,92,18);thumbnails[1759533]=new thumbnail(1759533,"178824","Robin","CAO_thumb.WP-0130a.jpg",130,91,18);thumbnails[2410104]=new thumbnail(2410104,"178824","","CAO_thumb.WP-02381.jpg",130,179,18);thumbnails[1666678]=new thumbnail(1666678,"112604","Lily","Black-&-White_thumb.014JPG.jpg",130,87,18);thumbnails[1668758]=new thumbnail(1668758,"112604","Nets","3W6B9680_thumb.jpg",130,84,18);thumbnails[1668759]=new thumbnail(1668759,"112604","Bell Wharf","3W6B9686_thumb.jpg",130,163,18);thumbnails[5031371]=new thumbnail(5031371,"112604","","IMG_0794bw_thumb.jpg",130,195,18);thumbnails[1668689]=new thumbnail(1668689,"112879","Hadleigh Castle 2","Castle-1_thumb.jpg",130,92,18);thumbnails[1672364]=new thumbnail(1672364,"112879","Coast","Black-&-White_thumb.013JPG.jpg",130,128,18);thumbnails[1673389]=new thumbnail(1673389,"112879","Shells","0001-150_thumb.jpg",130,87,18);thumbnails[1673418]=new thumbnail(1673418,"112879","","IMG_7775_thumb.jpg",130,195,18);thumbnails[4309916]=new thumbnail(4309916,"112879","","3W6B2432_thumb.jpg",130,195,18);thumbnails[4309981]=new thumbnail(4309981,"112879","","CAOWP-0224_thumb.jpg",130,91,18);thumbnails[4309983]=new thumbnail(4309983,"112879","","Beyond_the_Gate_thumb.jpg",130,92,18);thumbnails[4309985]=new thumbnail(4309985,"112879","","The-Tree1_thumb.jpg",130,96,18);thumbnails[5031362]=new thumbnail(5031362,"112879","","IMG_0786_thumb.JPG",130,86,18);thumbnails[5031369]=new thumbnail(5031369,"112879","","IMG_0788_thumb.JPG",130,85,18);thumbnails[5031375]=new thumbnail(5031375,"112879","","IMG_0836_thumb.JPG",130,87,18);thumbnails[5031377]=new thumbnail(5031377,"112879","","IMG_0839_thumb.JPG",130,195,18);thumbnails[5031378]=new thumbnail(5031378,"112879","","IMG_0840_thumb.JPG",130,91,18);thumbnails[5031379]=new thumbnail(5031379,"112879","","IMG_0844_thumb.JPG",130,179,18);var galleries=new Object();galleries[178819]=new gallery(178819,"2912048","Weddings","gallery",[1668786,1672361,2881075,2881118,2881123,2881126,2912048,2912082,2912095]);galleries[155833]=new gallery(155833,"4309903","Commercial and Corporate","gallery",[2406255,2406261,2406264,2406265,2406268,4307675,4307683,4309903]);galleries[155838]=new gallery(155838,"2406273,2406272,2406271,2406270,2406203,2406202,2406027","Sports Commissions","gallery",[2406027,2406202,2406203,2406270,2406271,2406272,2406273]);galleries[112602]=new gallery(112602,"1668788","Portraits","gallery",[1668788,1668790,1672363,1672366,1672367,2406293,4307693,4307695,4307707,4307721,4307732,4307735,4307741]);galleries[178824]=new gallery(178824,"1666620","Nature","gallery",[1663277,1666616,1666620,1666660,1759531,1759533,2410104]);galleries[112604]=new gallery(112604,"1668758,1666678","Black & White","gallery",[1666678,1668758,1668759,5031371]);galleries[112879]=new gallery(112879,"1673389","Miscellaneous","gallery",[1668689,1672364,1673389,1673418,4309916,4309981,4309983,4309985,5031362,5031369,5031375,5031377,5031378,5031379]);var imageSets=new Object();imageSets[114555]="4309903,4307683,4307675";imageSets[1]="4307732";imageSets[2]="4309903,2912048,1673389,1668788,1668758,1666678,1666620";imageSets[3]="5031379,5031378,5031377,5031375,5031371,5031369,5031362,4309985,4309983,4309981,4309916,4309903,4307741,4307735,4307732,4307721,4307707,4307695,4307693,4307683,4307675,2912095,2912082,2912048,2881126,2881123,2881118,2881075,2410107,2410104,2406293,2406273,2406272,2406271,2406270,2406268,2406265,2406264,2406261,2406255,2406203,2406202,2406027,1759533,1759532,1759531,1673418,1673389,1672367,1672366";imageSets[114559]="4307741,4307735,4307732,4307721,4307707,4307695,4307693";imageSets[138715]="1668786";imageSets[114562]="4309985,4309983,4309981,4309916,1668687";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/coakley/images";break}switch(a){case 1:b="http://www1.clikpic.com/coakley/images";break}switch(a){case 2:b="http://admin.clikpic.com/coakley/images";break}switch(a){case 4:b="http://www.clikchurch.com/coakley/images";break}switch(a){case 5:b="http://www2.clikpic.com/coakley/images";break}switch(a){case 15:b="http://www3.clikpic.com/coakley/images";break}switch(a){case 21:b="http://www6.clikpic.com/coakley/images";break}switch(a){case 18:b="http://www4.clikpic.com/coakley/images";break}switch(a){case 19:b="http://www5.clikpic.com/coakley/images";break}switch(a){case 22:b="http://tpc5/clikpic/coakley/images";break}switch(a){case 23:b="http://tpc10/clikpic/coakley/images";break}switch(a){case 24:b="http://tpc15/clikpic/coakley/images";break}switch(a){case 25:b="http://tpc16/clikpic/coakley/images";break}switch(a){case 31:b="http://www7.clikpic.com/coakley/images";break}switch(a){case 32:b="http://admin2.clikpic.com/coakley/images";break}switch(a){case 33:b="http://www8.clikpic.com/coakley/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="Chris Oakley 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>"}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="co@talktalk.net">';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="co@talktalk.net">';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+'")'})}}};