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[3273861]=new thumbnail(3273861,"208212","","IMG_93651_thumb.jpg",130,195,15);thumbnails[3273867]=new thumbnail(3273867,"208212","","IMG_94931_thumb.jpg",130,195,15);thumbnails[3274411]=new thumbnail(3274411,"","","IMG_2736_thumb.jpg",130,197,15);thumbnails[3274311]=new thumbnail(3274311,"199341","","IMG_3556_thumb.jpg",130,87,15);thumbnails[3274312]=new thumbnail(3274312,"199341","","IMG_4295_thumb.jpg",130,87,15);thumbnails[3274314]=new thumbnail(3274314,"199341","","IMG_4437_thumb.jpg",130,160,15);thumbnails[3274408]=new thumbnail(3274408,"199341","","IMG_2675_thumb.jpg",130,85,15);thumbnails[3274409]=new thumbnail(3274409,"199341","","IMG_2697_thumb.jpg",130,195,15);thumbnails[3298177]=new thumbnail(3298177,"199341","","B&W_IMG_3276_thumb.jpg",130,93,15);thumbnails[4640357]=new thumbnail(4640357,"267707","","IMG_0693_thumb.jpg",130,195,15);thumbnails[4640358]=new thumbnail(4640358,"267707","","IMG_0771_thumb.jpg",130,82,15);thumbnails[4640360]=new thumbnail(4640360,"267707","","IMG_0827_thumb.jpg",130,94,15);thumbnails[4640361]=new thumbnail(4640361,"267707","","IMG_0932_thumb.jpg",130,87,15);thumbnails[4640362]=new thumbnail(4640362,"267707","","IMG_0946_thumb.jpg",130,88,15);thumbnails[4640363]=new thumbnail(4640363,"267707","","IMG_1021_thumb.jpg",130,164,15);thumbnails[4640364]=new thumbnail(4640364,"267707","","IMG_1039_thumb.jpg",130,87,15);thumbnails[4640366]=new thumbnail(4640366,"267707","","IMG_1059_thumb.jpg",130,195,15);thumbnails[4640368]=new thumbnail(4640368,"267707","","IMG_1125_thumb.jpg",130,87,15);thumbnails[4640369]=new thumbnail(4640369,"267707","","IMG_1203_thumb.jpg",130,195,15);thumbnails[4640372]=new thumbnail(4640372,"267707","","IMG_1303_thumb.jpg",130,186,15);thumbnails[4640373]=new thumbnail(4640373,"267707","","IMG_1434_thumb.jpg",130,195,15);thumbnails[4640375]=new thumbnail(4640375,"267707","","IMG_1450_thumb.jpg",130,87,15);thumbnails[4640376]=new thumbnail(4640376,"267707","","IMG_1509_thumb.jpg",130,185,15);thumbnails[4640377]=new thumbnail(4640377,"267707","","IMG_7543_thumb.jpg",130,199,15);thumbnails[4781950]=new thumbnail(4781950,"267707","","IMG_1463_thumb.jpg",130,95,15);thumbnails[5524387]=new thumbnail(5524387,"199341","","IMG_9077_thumb.jpg",130,195,15);thumbnails[5524391]=new thumbnail(5524391,"199341","","IMG_9139_thumb.jpg",130,195,15);thumbnails[5524393]=new thumbnail(5524393,"199341","","IMG_9152_thumb.jpg",130,195,15);thumbnails[3274368]=new thumbnail(3274368,"199342","","IMG_1665_11_thumb.jpg",130,91,15);thumbnails[3274377]=new thumbnail(3274377,"199342","","IMG_1690_12_thumb.jpg",130,196,15);thumbnails[3274378]=new thumbnail(3274378,"199342","","IMG_1691_11_thumb.jpg",130,85,15);thumbnails[3274381]=new thumbnail(3274381,"199342","","IMG_17051_thumb.jpg",130,193,15);thumbnails[3274382]=new thumbnail(3274382,"199342","","IMG_17061_thumb.jpg",130,91,15);thumbnails[3274386]=new thumbnail(3274386,"199342","","IMG_1711_11_thumb.jpg",130,67,15);thumbnails[3274387]=new thumbnail(3274387,"199342","","IMG_17131_thumb.jpg",130,193,15);thumbnails[3274391]=new thumbnail(3274391,"199342","","IMG_1719_11_thumb.jpg",130,59,15);thumbnails[3274393]=new thumbnail(3274393,"199342","","IMG_1760_11_thumb.jpg",130,77,15);thumbnails[3274397]=new thumbnail(3274397,"199342","","IMG_1761_11_thumb.jpg",130,90,15);thumbnails[3274398]=new thumbnail(3274398,"199342","","IMG_1773_11_thumb.jpg",130,195,15);thumbnails[3274400]=new thumbnail(3274400,"199342","","IMG_1774_11_thumb.jpg",130,188,15);thumbnails[3274403]=new thumbnail(3274403,"199342","","IMG_1784_11_thumb.jpg",130,213,15);thumbnails[3274405]=new thumbnail(3274405,"199342","","IMG_1788_11_thumb.jpg",130,153,15);thumbnails[3274406]=new thumbnail(3274406,"199342","","IMG_1790_11_thumb.jpg",130,210,15);thumbnails[3273780]=new thumbnail(3273780,"199374","","_MG_63541_thumb.jpg",130,88,15);thumbnails[3273782]=new thumbnail(3273782,"199374","","_MG_63611_thumb.jpg",130,92,15);thumbnails[3273785]=new thumbnail(3273785,"199374","","_MG_63661_thumb.jpg",130,174,15);thumbnails[3273787]=new thumbnail(3273787,"199374","","_MG_63691_thumb.jpg",130,195,15);thumbnails[3273788]=new thumbnail(3273788,"199374","","_MG_63721_thumb.jpg",130,195,15);thumbnails[3273789]=new thumbnail(3273789,"199374","","_MG_63912_thumb.jpg",130,176,15);thumbnails[3273793]=new thumbnail(3273793,"199374","","_MG_64011_thumb.jpg",130,177,15);thumbnails[3273795]=new thumbnail(3273795,"199374","","_MG_64191_thumb.jpg",130,181,15);thumbnails[3274300]=new thumbnail(3274300,"199374","","edit1_thumb.jpg",130,198,15);thumbnails[3273709]=new thumbnail(3273709,"199380","","-2-34_thumb.jpg",130,87,15);thumbnails[3273712]=new thumbnail(3273712,"199380","","-2-37_thumb.jpg",130,87,15);thumbnails[3273714]=new thumbnail(3273714,"199380","","-2-40_thumb.jpg",130,87,15);thumbnails[3273716]=new thumbnail(3273716,"199380","","-2-73_thumb.jpg",130,89,15);thumbnails[3273718]=new thumbnail(3273718,"199380","","-2-97_thumb.jpg",130,87,15);thumbnails[3273722]=new thumbnail(3273722,"199380","","-2-100_thumb.jpg",130,87,15);thumbnails[3298158]=new thumbnail(3298158,"199380","","IMG_5422_thumb.jpg",130,87,15);thumbnails[3298160]=new thumbnail(3298160,"199380","","IMG_5421_thumb.jpg",130,86,15);thumbnails[3298163]=new thumbnail(3298163,"199380","","IMG_54281_thumb.jpg",130,87,15);thumbnails[3298165]=new thumbnail(3298165,"199380","","IMG_5427_thumb.jpg",130,164,15);thumbnails[3298257]=new thumbnail(3298257,"199380","","IMG_7711_thumb.jpg",130,95,15);thumbnails[3313940]=new thumbnail(3313940,"199380","","-2-85_thumb.jpg",130,72,15);thumbnails[3313941]=new thumbnail(3313941,"199380","","-2-94_thumb.jpg",130,90,15);thumbnails[3313943]=new thumbnail(3313943,"199380","","-2-101_thumb.jpg",130,90,15);thumbnails[3313945]=new thumbnail(3313945,"199380","","-8365_thumb.jpg",130,173,15);thumbnails[3313946]=new thumbnail(3313946,"199380","","-8370_thumb.jpg",130,202,15);thumbnails[3313947]=new thumbnail(3313947,"199380","","-8382_thumb.jpg",130,205,15);thumbnails[3274374]=new thumbnail(3274374,"201061","","IMG_1679_11_thumb.jpg",130,201,15);thumbnails[3395337]=new thumbnail(3395337,"207300","","IMG_2665_1_thumb.jpg",130,182,15);thumbnails[3395339]=new thumbnail(3395339,"207300","","IMG_2678_1_thumb.jpg",130,182,15);thumbnails[3395340]=new thumbnail(3395340,"207300","","IMG_2689_1_thumb.jpg",130,93,15);thumbnails[3395343]=new thumbnail(3395343,"207300","","IMG_2699_1_thumb.jpg",130,102,15);thumbnails[3395344]=new thumbnail(3395344,"207300","","IMG_2703_1_thumb.jpg",130,169,15);thumbnails[3395346]=new thumbnail(3395346,"207300","","IMG_2717_1_thumb.jpg",130,91,15);thumbnails[3395348]=new thumbnail(3395348,"207300","","IMG_2722_1_thumb.jpg",130,75,15);thumbnails[3395353]=new thumbnail(3395353,"207300","","IMG_2724_11_thumb.jpg",130,96,15);thumbnails[3395356]=new thumbnail(3395356,"207300","","IMG_2727_1_thumb.jpg",130,95,15);thumbnails[3395357]=new thumbnail(3395357,"207300","","IMG_2752_1_thumb.jpg",130,89,15);thumbnails[3395358]=new thumbnail(3395358,"207300","","IMG_2753_1_thumb.jpg",130,189,15);thumbnails[3395359]=new thumbnail(3395359,"207300","","IMG_2759_1_thumb.jpg",130,182,15);thumbnails[3395361]=new thumbnail(3395361,"207300","","IMG_2761_1_thumb.jpg",130,199,15);thumbnails[3395363]=new thumbnail(3395363,"207300","","IMG_2764_1_thumb.jpg",130,200,15);thumbnails[3408067]=new thumbnail(3408067,"201061","","Small_6356 copy_thumb.jpg",130,209,15);var galleries=new Object();galleries[208212]=new gallery(208212,"3273867,3273861","Proms","section256404",[3273861,3273867]);galleries[267707]=new gallery(267707,"4781950,4640377,4640376,4640375,4640373,4640372,4640369,4640368,4640366,4640364","Craig & Catherine","section246193",[4640357,4640358,4640360,4640361,4640362,4640363,4640364,4640366,4640368,4640369,4640372,4640373,4640375,4640376,4640377,4781950]);galleries[199341]=new gallery(199341,"5524393,5524391,5524387,3298177,3274409,3274408,3274314,3274312,3274311","Portraits","section247524",[3274311,3274312,3274314,3274408,3274409,3298177,5524387,5524391,5524393]);galleries[199342]=new gallery(199342,"3274406,3274405,3274403,3274400,3274398,3274397,3274393,3274391,3274387,3274386","Phil & Jo","section246193",[3274368,3274377,3274378,3274381,3274382,3274386,3274387,3274391,3274393,3274397,3274398,3274400,3274403,3274405,3274406]);galleries[199374]=new gallery(199374,"3274300,3273795,3273793,3273789,3273788,3273787,3273785,3273782,3273780","Mark & Sarah","section246193",[3273780,3273782,3273785,3273787,3273788,3273789,3273793,3273795,3274300]);galleries[199380]=new gallery(199380,"3313947,3313946,3313945,3313943,3313941,3313940,3298257,3298165,3298163,3298160","Special Occasions","section247525",[3273709,3273712,3273714,3273716,3273718,3273722,3298158,3298160,3298163,3298165,3298257,3313940,3313941,3313943,3313945,3313946,3313947]);galleries[207300]=new gallery(207300,"3395363,3395361,3395359,3395358,3395357,3395356,3395353,3395348,3395346,3395344","Janet & Des","section246193",[3395337,3395339,3395340,3395343,3395344,3395346,3395348,3395353,3395356,3395357,3395358,3395359,3395361,3395363]);galleries[201061]=new gallery(201061,"3408067,3274374","Weddings","gallery",[3274374,3408067]);var imageSets=new Object();imageSets[1]="5524391,3274314";imageSets[3]="5524393,5524391,5524387,4781950,4640377,4640376,4640375,4640373,4640372,4640369,4640368,4640366,4640364,4640363,4640362,4640361,4640360,4640358,4640357,3408067,3395363,3395361,3395359,3395358,3395357,3395356,3395353,3395348,3395346,3395344,3395343,3395340,3395339,3395337,3313947,3313946,3313945,3313943,3313941,3313940,3298257,3298177,3298165,3298163,3298160,3298158,3274411,3274409,3274408,3274406";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/garyabeal/images";break}switch(a){case 1:b="http://www1.clikpic.com/garyabeal/images";break}switch(a){case 2:b="http://admin.clikpic.com/garyabeal/images";break}switch(a){case 24:b="http://tpc15/clikpic/garyabeal/images";break}switch(a){case 4:b="http://www.clikchurch.com/garyabeal/images";break}switch(a){case 5:b="http://www2.clikpic.com/garyabeal/images";break}switch(a){case 22:b="http://tpc5/clikpic/garyabeal/images";break}switch(a){case 23:b="http://tpc10/clikpic/garyabeal/images";break}switch(a){case 25:b="http://tpc16/clikpic/garyabeal/images";break}switch(a){case 15:b="http://www3.clikpic.com/garyabeal/images";break}switch(a){case 18:b="http://www4.clikpic.com/garyabeal/images";break}switch(a){case 19:b="http://www5.clikpic.com/garyabeal/images";break}switch(a){case 31:b="http://www7.clikpic.com/garyabeal/images";break}switch(a){case 32:b="http://admin2.clikpic.com/garyabeal/images";break}switch(a){case 33:b="http://www8.clikpic.com/garyabeal/images";break}switch(a){case 34:b="http://www9.clikpic.com/garyabeal/images";break}switch(a){case 35:b="http://admin3.clikpic.com/garyabeal/images";break}switch(a){case 37:b="http://admin4.clikpic.com/garyabeal/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="VPPhotos: "+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;resizePhotoInfo();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(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}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+'")'})}}};