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[4019184]=new thumbnail(4019184,"","","0003_thumb.jpg",130,195,18);thumbnails[2071499]=new thumbnail(2071499,"138409","","IMG_1815web_thumb.jpg",130,158,18);thumbnails[2071500]=new thumbnail(2071500,"138409","","IMG_1879web_thumb.jpg",130,144,18);thumbnails[2075374]=new thumbnail(2075374,"138409","","IMG_0558web_thumb.jpg",130,91,18);thumbnails[4019194]=new thumbnail(4019194,"88668","","0070_thumb.jpg",130,87,18);thumbnails[4019195]=new thumbnail(4019195,"88668","","0094_thumb.jpg",130,160,18);thumbnails[4019196]=new thumbnail(4019196,"88668","","0101_thumb.jpg",130,87,18);thumbnails[4019198]=new thumbnail(4019198,"88668","","0112_thumb.jpg",130,195,18);thumbnails[4019200]=new thumbnail(4019200,"88668","","0121_thumb.jpg",130,104,18);thumbnails[4019201]=new thumbnail(4019201,"88668","","0129_thumb.jpg",130,117,18);thumbnails[4019204]=new thumbnail(4019204,"88668","","135_thumb.jpg",130,68,18);thumbnails[4019205]=new thumbnail(4019205,"88668","","140_thumb.jpg",130,163,18);thumbnails[4019206]=new thumbnail(4019206,"88668","","0147_thumb.jpg",130,163,18);thumbnails[4019207]=new thumbnail(4019207,"88668","","153_thumb.jpg",130,117,18);thumbnails[4019209]=new thumbnail(4019209,"88668","","0185_thumb.jpg",130,173,18);thumbnails[4019210]=new thumbnail(4019210,"88668","","0187_thumb.jpg",130,173,18);thumbnails[4019211]=new thumbnail(4019211,"88668","","0218_thumb.jpg",130,173,18);thumbnails[4019213]=new thumbnail(4019213,"88668","","0220_thumb.jpg",130,94,18);thumbnails[4019214]=new thumbnail(4019214,"88668","","IMG_1819_thumb.jpg",130,108,18);thumbnails[4019215]=new thumbnail(4019215,"88668","","IMG_1831_thumb.jpg",130,188,18);thumbnails[4019218]=new thumbnail(4019218,"88668","","IMG_1840_thumb.jpg",130,183,18);thumbnails[4019221]=new thumbnail(4019221,"88668","","IMG_1841_thumb.jpg",130,97,18);thumbnails[4019222]=new thumbnail(4019222,"88668","","IMG_2070_thumb.jpg",130,90,18);thumbnails[4019223]=new thumbnail(4019223,"88668","","IMG_2810_thumb.jpg",130,98,18);thumbnails[1855103]=new thumbnail(1855103,"124868","","IMG_0131_thumb.jpg",130,87,18);thumbnails[1460718]=new thumbnail(1460718,"89494","","IMG_8272_21_thumb.jpg",130,195,18);thumbnails[1460726]=new thumbnail(1460726,"89494","","IMG_8457_thumb.jpg",130,195,18);thumbnails[1460728]=new thumbnail(1460728,"89494","","IMG_0280BW_thumb.jpg",130,182,18);thumbnails[1460723]=new thumbnail(1460723,"89494","","IMG_8362SEP_thumb.jpg",130,61,18);thumbnails[1460725]=new thumbnail(1460725,"89494","","IMG_9917bw_thumb.jpg",130,67,18);thumbnails[1460720]=new thumbnail(1460720,"89494","","IMG_8190_22_thumb.jpg",130,93,18);thumbnails[1460722]=new thumbnail(1460722,"89494","","IMG_8306BW_thumb.jpg",130,89,18);thumbnails[1460727]=new thumbnail(1460727,"89494","","IMG_0224bwcol_thumb.jpg",130,83,18);thumbnails[1255436]=new thumbnail(1255436,"89494","","IMG_8365_thumb.jpg",130,75,18);thumbnails[2079762]=new thumbnail(2079762,"89494","","IMG_0856web_thumb.jpg",130,90,18);thumbnails[1255496]=new thumbnail(1255496,"89353","","IMG_0693_thumb.jpg",130,205,18);thumbnails[1255497]=new thumbnail(1255497,"89353","","IMG_5916_thumb.jpg",130,195,18);thumbnails[1255499]=new thumbnail(1255499,"89353","","IMG_0768_thumb.jpg",130,202,18);thumbnails[1255500]=new thumbnail(1255500,"89353","","IMG_5924_thumb.jpg",130,195,18);thumbnails[1255503]=new thumbnail(1255503,"89353","","IMG_5967_thumb.jpg",130,162,18);thumbnails[1255504]=new thumbnail(1255504,"89353","","IMG_5975_thumb.jpg",130,195,18);thumbnails[1255506]=new thumbnail(1255506,"89353","","IMG_6020_thumb.jpg",130,82,18);thumbnails[1255524]=new thumbnail(1255524,"89353","","Picture 006_thumb.jpg",130,173,18);thumbnails[1255525]=new thumbnail(1255525,"89353","","Picture 008_thumb.jpg",130,98,18);thumbnails[1255526]=new thumbnail(1255526,"89353","","Picture 012_thumb.jpg",130,173,18);thumbnails[1255527]=new thumbnail(1255527,"89353","","Picture 0201_thumb.jpg",130,98,18);thumbnails[1255528]=new thumbnail(1255528,"89353","","Picture 024_thumb.jpg",130,98,18);thumbnails[1255529]=new thumbnail(1255529,"89353","","Picture 030_thumb.jpg",130,98,18);thumbnails[1255531]=new thumbnail(1255531,"89353","","100_2319_thumb.jpg",130,173,18);thumbnails[1255532]=new thumbnail(1255532,"89353","","100_2320_thumb.jpg",130,173,18);thumbnails[1255533]=new thumbnail(1255533,"89353","","100_2350_thumb.jpg",130,173,18);thumbnails[1255534]=new thumbnail(1255534,"89353","","100_2322_thumb.jpg",130,173,18);thumbnails[1255535]=new thumbnail(1255535,"89353","","100_2360_thumb.jpg",130,98,18);thumbnails[1255537]=new thumbnail(1255537,"89353","","100_2355_thumb.jpg",130,173,18);thumbnails[1255540]=new thumbnail(1255540,"89353","","IMG_1539_thumb.jpg",130,195,18);thumbnails[1259883]=new thumbnail(1259883,"89353","","0051_thumb.jpg",130,104,18);thumbnails[4019185]=new thumbnail(4019185,"89353","","0006_thumb.jpg",130,194,18);thumbnails[4019188]=new thumbnail(4019188,"89353","","0011_thumb.jpg",130,98,18);thumbnails[4019189]=new thumbnail(4019189,"89353","","0014_thumb.jpg",130,197,18);thumbnails[4019191]=new thumbnail(4019191,"89353","","0021_thumb.jpg",130,195,18);thumbnails[4019192]=new thumbnail(4019192,"89353","","0033_thumb.jpg",130,173,18);thumbnails[4019193]=new thumbnail(4019193,"89353","","0058_thumb.jpg",130,195,18);thumbnails[1255522]=new thumbnail(1255522,"89357","","Picture 001_thumb.jpg",130,173,18);thumbnails[1255523]=new thumbnail(1255523,"89357","","Picture 003_thumb.jpg",130,173,18);thumbnails[1255450]=new thumbnail(1255450,"89359","","00111_thumb.jpg",130,80,18);thumbnails[1255456]=new thumbnail(1255456,"89359","","0034_thumb.jpg",130,210,18);thumbnails[1255459]=new thumbnail(1255459,"89359","","0042_thumb.jpg",130,99,18);thumbnails[1255461]=new thumbnail(1255461,"89359","","0053_thumb.jpg",130,195,18);thumbnails[1255462]=new thumbnail(1255462,"89359","","0064_thumb.jpg",130,87,18);thumbnails[1255463]=new thumbnail(1255463,"89359","","0072_thumb.jpg",130,87,18);thumbnails[1255464]=new thumbnail(1255464,"89359","","0078_thumb.jpg",130,150,18);thumbnails[1255466]=new thumbnail(1255466,"89359","","0116_thumb.jpg",130,95,18);thumbnails[1255467]=new thumbnail(1255467,"89359","","0123_thumb.jpg",130,87,18);thumbnails[1255510]=new thumbnail(1255510,"89359","","Picture 007_thumb.jpg",130,173,18);thumbnails[1255512]=new thumbnail(1255512,"89359","","Picture 013_thumb.jpg",130,98,18);thumbnails[1255513]=new thumbnail(1255513,"89359","","Picture 015_thumb.jpg",130,173,18);thumbnails[1255514]=new thumbnail(1255514,"89359","","Picture 020_thumb.jpg",130,195,18);thumbnails[1255515]=new thumbnail(1255515,"89359","","Picture 070_thumb.jpg",130,173,18);thumbnails[4020768]=new thumbnail(4020768,"242664","","B71large_thumb.jpg",130,182,18);var galleries=new Object();galleries[124868]=new gallery(124868,"1855103","Commercial","section163155",[1855103]);galleries[88668]=new gallery(88668,"4019223,4019222,4019221,4019218,4019215,4019214,4019213,4019211,4019210,4019209","Gallery 1","gallery",[4019194,4019195,4019196,4019198,4019200,4019201,4019204,4019205,4019206,4019207,4019209,4019210,4019211,4019213,4019214,4019215,4019218,4019221,4019222,4019223]);galleries[138409]=new gallery(138409,"2075374,2071500,2071499","Pets","section178875",[2071499,2071500,2075374]);galleries[89494]=new gallery(89494,"2079762,1460728,1460727,1460726,1460725,1460723,1460722,1460720,1460718,1255436","Portrait","section121956",[1460718,1460726,1460728,1460723,1460725,1460720,1460722,1460727,1255436,2079762]);galleries[89353]=new gallery(89353,"4019193,4019192,4019191,4019189,4019188,4019185,1259883,1255540,1255537,1255535","Gallery 2","gallery",[1255496,1255497,1255499,1255500,1255503,1255504,1255506,1255524,1255525,1255526,1255527,1255528,1255529,1255531,1255532,1255533,1255534,1255535,1255537,1255540,1259883,4019185,4019188,4019189,4019191,4019192,4019193]);galleries[89357]=new gallery(89357,"1255523,1255522","Gallery 3","gallery",[1255522,1255523]);galleries[89359]=new gallery(89359,"1255515,1255514,1255513,1255512,1255510,1255467,1255466,1255464,1255463,1255462","Gallery 4","gallery",[1255450,1255456,1255459,1255461,1255462,1255463,1255464,1255466,1255467,1255510,1255512,1255513,1255514,1255515]);galleries[242664]=new gallery(242664,"4020768","Schools","section294915",[4020768]);var imageSets=new Object();imageSets[1]="4019185";imageSets[3]="4020768,4019223,4019222,4019221,4019218,4019215,4019214,4019213,4019211,4019210,4019209,4019207,4019206,4019205,4019204,4019201,4019200,4019198,4019196,4019195,4019194,4019193,4019192,4019191,4019189,4019188,4019185,4019184,2079762,2075374,2071500,2071499,1855103,1460728,1460727,1460726,1460725,1460723,1460722,1460720,1460718,1259883,1255540,1255537,1255535,1255534,1255533,1255532,1255531,1255529";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/nickb007/images";break}switch(a){case 1:b="http://www1.clikpic.com/nickb007/images";break}switch(a){case 2:b="http://admin.clikpic.com/nickb007/images";break}switch(a){case 4:b="http://www.clikchurch.com/nickb007/images";break}switch(a){case 5:b="http://www2.clikpic.com/nickb007/images";break}switch(a){case 15:b="http://www3.clikpic.com/nickb007/images";break}switch(a){case 21:b="http://www6.clikpic.com/nickb007/images";break}switch(a){case 18:b="http://www4.clikpic.com/nickb007/images";break}switch(a){case 19:b="http://www5.clikpic.com/nickb007/images";break}switch(a){case 22:b="http://tpc5/clikpic/nickb007/images";break}switch(a){case 23:b="http://tpc10/clikpic/nickb007/images";break}switch(a){case 24:b="http://tpc15/clikpic/nickb007/images";break}switch(a){case 25:b="http://tpc16/clikpic/nickb007/images";break}switch(a){case 31:b="http://www7.clikpic.com/nickb007/images";break}switch(a){case 32:b="http://admin2.clikpic.com/nickb007/images";break}switch(a){case 33:b="http://www8.clikpic.com/nickb007/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="Gautrey-Brawn 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> 				&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+'<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+'")'})}}};