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[1316609]=new thumbnail(1316609,"18653","","IMG_6458_thumb.JPG",130,87,18);thumbnails[5332647]=new thumbnail(5332647,"18653","","web1_thumb.JPG",130,83,18);thumbnails[2910624]=new thumbnail(2910624,"18653","","IMG_3454_thumb.JPG",130,92,18);thumbnails[5332642]=new thumbnail(5332642,"18653","","89_b__w_thumb.JPG",130,201,18);thumbnails[842835]=new thumbnail(842835,"18653","","025_thumb.JPG",130,195,18);thumbnails[842901]=new thumbnail(842901,"18653","","20_thumb.JPG",130,195,18);thumbnails[842935]=new thumbnail(842935,"18653","","30_thumb.JPG",130,195,18);thumbnails[842937]=new thumbnail(842937,"18653","","50_thumb.JPG",130,96,18);thumbnails[842938]=new thumbnail(842938,"18653","","60_thumb.JPG",130,95,18);thumbnails[842939]=new thumbnail(842939,"18653","","70_thumb.JPG",130,195,18);thumbnails[842941]=new thumbnail(842941,"18653","","80_thumb.JPG",130,195,18);thumbnails[842942]=new thumbnail(842942,"18653","","90_thumb.JPG",130,181,18);thumbnails[1009862]=new thumbnail(1009862,"18653","","IMG_4917 copy_thumb.jpg",130,87,18);thumbnails[842945]=new thumbnail(842945,"18653","","110_thumb.JPG",130,195,18);thumbnails[842948]=new thumbnail(842948,"18653","","130_thumb.JPG",130,195,18);thumbnails[842949]=new thumbnail(842949,"18653","","140_thumb.JPG",130,195,18);thumbnails[842951]=new thumbnail(842951,"18653","","150_thumb.JPG",130,87,18);thumbnails[842954]=new thumbnail(842954,"18653","","160_thumb.JPG",130,195,18);thumbnails[842955]=new thumbnail(842955,"18653","","170_thumb.JPG",130,122,18);thumbnails[842965]=new thumbnail(842965,"18653","","180_thumb.JPG",130,195,18);thumbnails[2910638]=new thumbnail(2910638,"38698","","IMG_6407_thumb.jpg",130,163,18);thumbnails[2910653]=new thumbnail(2910653,"38698","","IMG_5581_thumb.JPG",130,199,18);thumbnails[842967]=new thumbnail(842967,"38698","","101_thumb.JPG",130,195,18);thumbnails[842968]=new thumbnail(842968,"38698","","201_thumb.JPG",130,195,18);thumbnails[842969]=new thumbnail(842969,"38698","","301_thumb.JPG",130,195,18);thumbnails[842970]=new thumbnail(842970,"38698","","401_thumb.JPG",130,87,18);thumbnails[842972]=new thumbnail(842972,"38698","","601_thumb.JPG",130,87,18);thumbnails[842973]=new thumbnail(842973,"38698","","701_thumb.JPG",130,195,18);thumbnails[842975]=new thumbnail(842975,"38698","","901_thumb.JPG",130,178,18);thumbnails[842976]=new thumbnail(842976,"38698","","1001_thumb.JPG",130,87,18);thumbnails[842977]=new thumbnail(842977,"38698","","1101_thumb.JPG",130,145,18);thumbnails[842978]=new thumbnail(842978,"38698","","1201_thumb.JPG",130,87,18);thumbnails[929607]=new thumbnail(929607,"18655","","IMG_4356 copy_thumb.jpg",130,87,18);thumbnails[1210515]=new thumbnail(1210515,"18655","","IMG_5836_thumb.jpg",130,81,18);thumbnails[1316610]=new thumbnail(1316610,"18655","","IMG_6231_thumb.jpg",130,87,18);thumbnails[1493405]=new thumbnail(1493405,"18655","","CC_thumb.JPG",130,87,18);thumbnails[3137535]=new thumbnail(3137535,"18655","","IMG_3952 copy_thumb.jpg",130,171,18);thumbnails[3137537]=new thumbnail(3137537,"18655","","IMG_4141 copy_thumb.jpg",130,87,18);thumbnails[5333223]=new thumbnail(5333223,"18655","","laura1_thumb.jpg",130,200,18);thumbnails[1493414]=new thumbnail(1493414,"18655","","CM_thumb.jpg",130,195,18);thumbnails[1493417]=new thumbnail(1493417,"18655","","Cm Chair_thumb.jpg",130,87,18);thumbnails[5333227]=new thumbnail(5333227,"18655","","zo2_thumb.jpg",130,195,18);thumbnails[2911535]=new thumbnail(2911535,"18655","","47064f3731aad_thumb.jpg",130,134,18);thumbnails[3137529]=new thumbnail(3137529,"18655","","IMG_3917 copy_thumb.jpg",130,224,18);thumbnails[2911373]=new thumbnail(2911373,"18655","","IMG_2183_thumb.JPG",130,251,18);thumbnails[843086]=new thumbnail(843086,"18655","","202_thumb.JPG",130,87,18);thumbnails[843087]=new thumbnail(843087,"18655","","302_thumb.JPG",130,87,18);thumbnails[843090]=new thumbnail(843090,"18655","","602_thumb.JPG",130,195,18);thumbnails[1210541]=new thumbnail(1210541,"38697","","IMG_5761_thumb.jpg",130,195,18);thumbnails[2911507]=new thumbnail(2911507,"38697","","46addacb7c5fe_thumb.jpg",130,195,18);thumbnails[2911509]=new thumbnail(2911509,"38697","","46addb6f844d5_thumb.jpg",130,195,18);thumbnails[2911405]=new thumbnail(2911405,"38697","","IMG_2226_thumb.JPG",130,195,18);thumbnails[2911429]=new thumbnail(2911429,"38697","","IMG_2255 copy_thumb.jpg",130,114,18);thumbnails[5333257]=new thumbnail(5333257,"38697","","zo_thumb.jpg",130,125,18);thumbnails[843103]=new thumbnail(843103,"38697","","103_thumb.JPG",130,195,18);thumbnails[5333256]=new thumbnail(5333256,"38697","","laura2_thumb.jpg",130,168,18);thumbnails[843105]=new thumbnail(843105,"38697","","303_thumb.JPG",130,195,18);thumbnails[843109]=new thumbnail(843109,"38697","","603_thumb.jpg",130,87,18);thumbnails[843092]=new thumbnail(843092,"38697","","802_thumb.JPG",130,195,18);thumbnails[843120]=new thumbnail(843120,"38697","","1003_thumb.JPG",130,195,18);thumbnails[2911359]=new thumbnail(2911359,"18654","","IMG_0727_thumb.JPG",130,195,18);thumbnails[3137545]=new thumbnail(3137545,"18654","","IMG_44021_thumb.JPG",130,178,18);thumbnails[3137547]=new thumbnail(3137547,"18654","","IMG_44281_thumb.JPG",130,165,18);thumbnails[2911355]=new thumbnail(2911355,"18654","","IMG_0616_thumb.JPG",130,144,18);thumbnails[5333369]=new thumbnail(5333369,"18654","","gs_thumb.JPG",130,177,18);thumbnails[844177]=new thumbnail(844177,"18654","","105_thumb.jpg",130,87,18);thumbnails[2911361]=new thumbnail(2911361,"18654","","IMG_1856_thumb.JPG",130,86,18);thumbnails[1493424]=new thumbnail(1493424,"18654","","K & L_thumb.JPG",130,94,18);thumbnails[844179]=new thumbnail(844179,"18654","","305_thumb.jpg",130,195,18);thumbnails[844180]=new thumbnail(844180,"18654","","405_thumb.JPG",130,87,18);thumbnails[844181]=new thumbnail(844181,"18654","","505_thumb.JPG",130,196,18);thumbnails[844188]=new thumbnail(844188,"18654","","1104_thumb.JPG",130,87,18);thumbnails[791723]=new thumbnail(791723,"61522","","IMG_0374_thumb.jpg",130,100,18);thumbnails[791724]=new thumbnail(791724,"61522","","IMG_0384_thumb.jpg",130,112,18);thumbnails[791736]=new thumbnail(791736,"61522","","IMG_0482_thumb.JPG",130,189,18);thumbnails[1210510]=new thumbnail(1210510,"61522","","IMG_5846_thumb.jpg",130,91,18);thumbnails[1210512]=new thumbnail(1210512,"61522","","Idea 1_thumb.jpg",130,178,18);thumbnails[1009843]=new thumbnail(1009843,"61522","","IMG_4683_thumb.JPG",130,198,18);thumbnails[5332699]=new thumbnail(5332699,"61522","","crimbo_1_wp_thumb.JPG",130,180,18);thumbnails[5333365]=new thumbnail(5333365,"61522","","IMG_5071_thumb.JPG",130,211,18);thumbnails[1009845]=new thumbnail(1009845,"61522","","IMG_4690_thumb.JPG",130,195,18);thumbnails[2910667]=new thumbnail(2910667,"61522","","IMG_1763_1_thumb.JPG",130,204,18);thumbnails[2910661]=new thumbnail(2910661,"61522","","IMG_2967_thumb.JPG",130,201,18);thumbnails[1009841]=new thumbnail(1009841,"61522","","IMG_4676_thumb.JPG",130,195,18);thumbnails[842800]=new thumbnail(842800,"38700","","IMG_1862_thumb.JPG",130,87,18);thumbnails[842791]=new thumbnail(842791,"38700","","0063_thumb.JPG",130,87,18);thumbnails[842793]=new thumbnail(842793,"38700","","IMG_1755_thumb.JPG",130,252,18);thumbnails[842796]=new thumbnail(842796,"38700","","IMG_1867_thumb.JPG",130,87,18);thumbnails[842798]=new thumbnail(842798,"38700","","IMG_1763_thumb.JPG",130,205,18);thumbnails[842801]=new thumbnail(842801,"38700","","IMG_17771_thumb.JPG",130,195,18);thumbnails[842803]=new thumbnail(842803,"38700","","IMG_18501_thumb.JPG",130,92,18);thumbnails[842807]=new thumbnail(842807,"38700","","IMG_1799_thumb.JPG",130,195,18);thumbnails[842809]=new thumbnail(842809,"38700","","IMG_18451_thumb.JPG",130,87,18);thumbnails[842811]=new thumbnail(842811,"38700","","IMG_18121_thumb.JPG",130,195,18);thumbnails[842818]=new thumbnail(842818,"38700","","IMG_1821_thumb.JPG",130,195,18);var galleries=new Object();galleries[18653]=new gallery(18653,"2910624,842939,842835","Weddings","gallery",[1316609,5332647,2910624,5332642,842835,842901,842935,842937,842938,842939,842941,842942,1009862,842945,842948,842949,842951,842954,842955,842965]);galleries[38698]=new gallery(38698,"842967","Weddings 2","gallery",[2910638,2910653,842967,842968,842969,842970,842972,842973,842975,842976,842977,842978]);galleries[18655]=new gallery(18655,"2911535,2911373","Portraits ","gallery",[929607,1210515,1316610,1493405,3137535,3137537,5333223,1493414,1493417,5333227,2911535,3137529,2911373,843086,843087,843090]);galleries[38697]=new gallery(38697,"2911405","Portraits 2","gallery",[1210541,2911507,2911509,2911405,2911429,5333257,843103,5333256,843105,843109,843092,843120]);galleries[18654]=new gallery(18654,"3137547,3137545,844179","Family Portraits","gallery",[2911359,3137545,3137547,2911355,5333369,844177,2911361,1493424,844179,844180,844181,844188]);galleries[61522]=new gallery(61522,"5333365","Pregnancy & Babies","gallery",[791723,791724,791736,1210510,1210512,1009843,5332699,5333365,1009845,2910667,2910661,1009841]);galleries[38700]=new gallery(38700,"842800","Engagement","gallery",[842800,842791,842793,842796,842798,842801,842803,842807,842809,842811,842818]);var imageSets=new Object();imageSets[1]="5332647,1493417,929607";imageSets[2]="5333365,3137547,3137545,2911535,2911405,2911373,2910624,844179,842967,842939,842835,842800";imageSets[3]="5333369,5333365,5333257,5333256,5333227,5333223,5332699,5332647,5332642,3137547,3137545,3137537,3137535,3137529,2911535,2911509,2911507,2911429,2911405,2911373,2911361,2911359,2911355,2910667,2910661,2910653,2910638,2910624,1493424,1493417,1493414,1493405,1316610,1316609,1210541,1210515,1210512,1210510,1009862,1009845,1009843,1009841,929607,844188,844181,844180,844179,844177,843120,843109";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/loader95/images";break}switch(a){case 1:b="http://www1.clikpic.com/loader95/images";break}switch(a){case 2:b="http://admin.clikpic.com/loader95/images";break}switch(a){case 24:b="http://tpc15/clikpic/loader95/images";break}switch(a){case 4:b="http://www.clikchurch.com/loader95/images";break}switch(a){case 5:b="http://www2.clikpic.com/loader95/images";break}switch(a){case 22:b="http://tpc5/clikpic/loader95/images";break}switch(a){case 23:b="http://tpc10/clikpic/loader95/images";break}switch(a){case 25:b="http://tpc16/clikpic/loader95/images";break}switch(a){case 15:b="http://www3.clikpic.com/loader95/images";break}switch(a){case 18:b="http://www4.clikpic.com/loader95/images";break}switch(a){case 19:b="http://www5.clikpic.com/loader95/images";break}switch(a){case 31:b="http://www7.clikpic.com/loader95/images";break}switch(a){case 32:b="http://admin2.clikpic.com/loader95/images";break}switch(a){case 33:b="http://www8.clikpic.com/loader95/images";break}switch(a){case 34:b="http://www9.clikpic.com/loader95/images";break}switch(a){case 35:b="http://admin3.clikpic.com/loader95/images";break}switch(a){case 37:b="http://admin4.clikpic.com/loader95/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="Eden Bailey 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+'")'})}}};