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[1871018]=new thumbnail(1871018,"88063","","Baptism3_thumb.jpg",130,98,15);thumbnails[1955335]=new thumbnail(1955335,"86673","","Baptism4_thumb.jpg",130,98,15);thumbnails[1955337]=new thumbnail(1955337,"88044","<br>\r\n","Baptism5_thumb.jpg",130,98,15);thumbnails[1955340]=new thumbnail(1955340,"88187","","Baptism6_thumb.jpg",130,98,15);thumbnails[1955375]=new thumbnail(1955375,"131337","","Baptism7_thumb.jpg",130,98,15);thumbnails[1871033]=new thumbnail(1871033,"88064","","Wedding4_thumb.jpg",130,98,15);thumbnails[1231519]=new thumbnail(1231519,"86668","","Wedding5_thumb.jpg",130,98,15);thumbnails[1955353]=new thumbnail(1955353,"88045","","Wedding6_thumb.jpg",130,98,15);thumbnails[1955355]=new thumbnail(1955355,"88188","","Wedding7_thumb.jpg",130,98,15);thumbnails[1955357]=new thumbnail(1955357,"131338","","Wedding8_thumb.jpg",130,98,15);thumbnails[1871026]=new thumbnail(1871026,"88065","","Funeral4_thumb.jpg",130,98,15);thumbnails[1231516]=new thumbnail(1231516,"86675","<br>\r\n","Funeral5_thumb.jpg",130,98,15);thumbnails[1955372]=new thumbnail(1955372,"86672","","Funeral8_thumb.jpg",130,98,15);thumbnails[1955367]=new thumbnail(1955367,"88189","","Funeral6_thumb.jpg",130,98,15);thumbnails[1955368]=new thumbnail(1955368,"131339","","Funeral7_thumb.jpg",130,98,15);thumbnails[1871035]=new thumbnail(1871035,"88066","","Sunday4_thumb.jpg",130,98,15);thumbnails[1231518]=new thumbnail(1231518,"86670","","Sunday5_thumb.jpg",130,98,15);thumbnails[1955377]=new thumbnail(1955377,"88046","","Sunday6_thumb.jpg",130,98,15);thumbnails[1955379]=new thumbnail(1955379,"88190","","Sunday7_thumb.jpg",130,98,15);thumbnails[1955382]=new thumbnail(1955382,"131340","","Sunday8_thumb.jpg",130,98,15);thumbnails[1871028]=new thumbnail(1871028,"88067","","News9_thumb.jpg",130,98,15);thumbnails[1231517]=new thumbnail(1231517,"86676","","News5_thumb.jpg",130,98,15);thumbnails[1955387]=new thumbnail(1955387,"88047","","News6_thumb.jpg",130,98,15);thumbnails[1955388]=new thumbnail(1955388,"88191","","News7_thumb.jpg",130,98,15);thumbnails[1955389]=new thumbnail(1955389,"131341","","News8_thumb.jpg",130,98,15);thumbnails[1871023]=new thumbnail(1871023,"88068","","Contact4_thumb.jpg",130,98,15);thumbnails[1231515]=new thumbnail(1231515,"86677","","Contact5_thumb.jpg",130,98,15);thumbnails[1956977]=new thumbnail(1956977,"88048","","Contact6_thumb.jpg",130,98,15);thumbnails[1956978]=new thumbnail(1956978,"88192","","Contact7_thumb.jpg",130,98,15);thumbnails[1956979]=new thumbnail(1956979,"131342","","Contact8_thumb.jpg",130,98,15);thumbnails[1958425]=new thumbnail(1958425,"137175","","home_splash 4_thumb.jpg",130,98,15);thumbnails[2172667]=new thumbnail(2172667,"143954","","001_Entrance_thumb.jpg",130,95,15);thumbnails[2172689]=new thumbnail(2172689,"143954","","016_Sweets_thumb.jpg",130,98,15);thumbnails[2172700]=new thumbnail(2172700,"143954","","044_BouncyCastle_thumb.jpg",130,96,15);thumbnails[2172694]=new thumbnail(2172694,"143954","","022_CakeStall_thumb.jpg",130,173,15);thumbnails[2172701]=new thumbnail(2172701,"143954","","053_PopCorn_thumb.jpg",130,173,15);thumbnails[2172682]=new thumbnail(2172682,"143954","","006_BookStall_thumb.jpg",130,98,15);thumbnails[2172703]=new thumbnail(2172703,"143954","","057_BeatTheGoalie_thumb.jpg",130,95,15);thumbnails[2172686]=new thumbnail(2172686,"143954","","012__CuddlyToys_thumb.jpg",130,98,15);thumbnails[2172679]=new thumbnail(2172679,"143954","","002_PlantSale_thumb.jpg",130,98,15);thumbnails[2172692]=new thumbnail(2172692,"143954","","018_Booze_thumb.jpg",130,98,15);thumbnails[2172697]=new thumbnail(2172697,"143954","","027_Cafe_thumb.jpg",130,98,15);var galleries=new Object();galleries[88063]=new gallery(88063,"1871018","Baptisms","section120487",[1871018]);galleries[86673]=new gallery(86673,"1955335","Baptisms","section119026",[1955335]);galleries[88044]=new gallery(88044,"1955337","Baptisms","section119036",[1955337]);galleries[88187]=new gallery(88187,"1955340","Baptisms","section120484",[1955340]);galleries[131337]=new gallery(131337,"1955375","Baptisms","section120486",[1955375]);galleries[88064]=new gallery(88064,"1871033","Weddings","section120487",[1871033]);galleries[86668]=new gallery(86668,"1231519","Weddings","section119026",[1231519]);galleries[88045]=new gallery(88045,"1955353","Weddings","section119036",[1955353]);galleries[88188]=new gallery(88188,"1955355","Weddings","section120484",[1955355]);galleries[131338]=new gallery(131338,"1955357","Weddings","section120486",[1955357]);galleries[88065]=new gallery(88065,"1871026","Funerals","section120487",[1871026]);galleries[86675]=new gallery(86675,"1231516","Funerals","section119026",[1231516]);galleries[86672]=new gallery(86672,"1955372","Funerals","section119036",[1955372]);galleries[88189]=new gallery(88189,"1955367","Funerals","section120484",[1955367]);galleries[131339]=new gallery(131339,"1955368","Funerals","section120486",[1955368]);galleries[88066]=new gallery(88066,"1871035","Sundays","section120487",[1871035]);galleries[86670]=new gallery(86670,"1231518","Sundays","section119026",[1231518]);galleries[88046]=new gallery(88046,"1955377","Sundays","section119036",[1955377]);galleries[88190]=new gallery(88190,"1955379","Sundays","section120484",[1955379]);galleries[131340]=new gallery(131340,"1955382","Sundays","section120486",[1955382]);galleries[88067]=new gallery(88067,"1871028","Events","section120487",[1871028]);galleries[86676]=new gallery(86676,"1231517","Events","section119026",[1231517]);galleries[88047]=new gallery(88047,"1955387","Events","section119036",[1955387]);galleries[88191]=new gallery(88191,"1955388","Events","section120484",[1955388]);galleries[131341]=new gallery(131341,"1955389","Events","section120486",[1955389]);galleries[88068]=new gallery(88068,"1871023","Contacts","section120487",[1871023]);galleries[86677]=new gallery(86677,"1231515","Contacts","section119026",[1231515]);galleries[88048]=new gallery(88048,"1956977","Contacts","section119036",[1956977]);galleries[88192]=new gallery(88192,"1956978","Contacts","section120484",[1956978]);galleries[131342]=new gallery(131342,"1956979","Contacts","section120486",[1956979]);galleries[137175]=new gallery(137175,"1958425","Team Events","section177441",[1958425]);galleries[143954]=new gallery(143954,"2172703,2172701,2172700,2172697,2172694,2172692,2172689,2172686,2172682,2172679","May Fayre 2008","section185199",[2172667,2172689,2172700,2172694,2172701,2172682,2172703,2172686,2172679,2172692,2172697]);var imageSets=new Object();imageSets[1]="1958425";imageSets[2]="1231519,1231518,1231516,1231515";imageSets[3]="2172703,2172701,2172700,2172697,2172694,2172692,2172689,2172686,2172682,2172679,2172667,1958425,1956979,1956978,1956977,1955389,1955388,1955387,1955382,1955379,1955377,1955375,1955372,1955368,1955367,1955357,1955355,1955353,1955340,1955337,1955335,1871035,1871033,1871028,1871026,1871023,1871018,1231519,1231518,1231517,1231516,1231515";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/caterham/images";break}switch(a){case 1:b="http://www1.clikpic.com/caterham/images";break}switch(a){case 2:b="http://admin.clikpic.com/caterham/images";break}switch(a){case 24:b="http://tpc15/clikpic/caterham/images";break}switch(a){case 4:b="http://www.clikchurch.com/caterham/images";break}switch(a){case 5:b="http://www2.clikpic.com/caterham/images";break}switch(a){case 22:b="http://tpc5/clikpic/caterham/images";break}switch(a){case 23:b="http://tpc10/clikpic/caterham/images";break}switch(a){case 25:b="http://tpc16/clikpic/caterham/images";break}switch(a){case 15:b="http://www3.clikpic.com/caterham/images";break}switch(a){case 18:b="http://www4.clikpic.com/caterham/images";break}switch(a){case 19:b="http://www5.clikpic.com/caterham/images";break}switch(a){case 31:b="http://www7.clikpic.com/caterham/images";break}switch(a){case 32:b="http://admin2.clikpic.com/caterham/images";break}switch(a){case 33:b="http://www8.clikpic.com/caterham/images";break}switch(a){case 34:b="http://www9.clikpic.com/caterham/images";break}switch(a){case 35:b="http://admin3.clikpic.com/caterham/images";break}switch(a){case 37:b="http://admin4.clikpic.com/caterham/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("section120487"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section120487.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("section120487"!=""){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="Caterham Team Ministry: "+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+'")'})}}};