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[4651224]=new thumbnail(4651224,"37113","The Triptych Women, 2009.","Triptych-women-2nd-version_thumb.jpg",130,62,18);thumbnails[4684203]=new thumbnail(4684203,"37113","Three Men and a Black Stripe, 2009.","Three-Men-and-A-Black-Strip_thumb.jpg",130,95,18);thumbnails[3846794]=new thumbnail(3846794,"37113","Dotty the First, 2009.","Dotty-1-web_thumb.jpg",130,133,18);thumbnails[3846791]=new thumbnail(3846791,"37113","Dotty the Second, 2009.","Dotty-2-web_thumb.jpg",130,128,18);thumbnails[2832771]=new thumbnail(2832771,"37113","Balasana, 2009.","Balasana-2_thumb.jpg",130,123,18);thumbnails[2832802]=new thumbnail(2832802,"37113","Sleeping, 2009.","Sleeping-2_thumb.jpg",130,97,18);thumbnails[2832803]=new thumbnail(2832803,"37113","Toes, 2009.","Toes-2_thumb.jpg",130,124,18);thumbnails[2808266]=new thumbnail(2808266,"37113","Male Nude (in the pink #1), 2008.","Pink-Man-2_thumb.jpg",130,188,18);thumbnails[2808267]=new thumbnail(2808267,"37113","Male Nude (In The Pink #2), 2008.","In The Pink 2_thumb.jpg",130,187,18);thumbnails[2832800]=new thumbnail(2832800,"37113","Male Nude (In The Pink #3), 2008.","In-The-Pink-3_thumb.jpg",130,176,18);thumbnails[2808269]=new thumbnail(2808269,"37113","Female Nude (Shadow #1), 2008.","Shadow 1_thumb.jpg",130,187,18);thumbnails[2808272]=new thumbnail(2808272,"37113","Female Nude (Shadow #2), 2008.","Shadow 2_thumb.jpg",130,190,18);thumbnails[2832673]=new thumbnail(2832673,"37113","Female Nude (Shadow #3), 2008.","Shadow-3_thumb.jpg",130,163,18);thumbnails[2548670]=new thumbnail(2548670,"37113","Sitges I, 2008.","Sitges I_thumb.jpg",130,128,18);thumbnails[2548673]=new thumbnail(2548673,"37113","Sitges II, 2008.","Sitges II_thumb.jpg",130,130,18);thumbnails[2548675]=new thumbnail(2548675,"37113","Stiges III, 2008.","Sitges III_thumb.jpg",130,130,18);thumbnails[2548677]=new thumbnail(2548677,"37113","Sitges IV, 2008.","Sitges IV_thumb.jpg",130,122,18);thumbnails[779857]=new thumbnail(779857,"37113","SQ-Purple Nude I, 2007.","SQ-Purple-Nude-I_thumb.jpg",130,126,18);thumbnails[779860]=new thumbnail(779860,"37113","SQ-Purple Nude II, 2007.","SQ-Purple-Nude-II_thumb.jpg",130,130,18);thumbnails[5921022]=new thumbnail(5921022,"37116","Eve, 2010.","Collage-Nude_thumb.jpg",130,175,18);thumbnails[6605567]=new thumbnail(6605567,"37116","Collaged Nude 1, 2010.","Collage-1_thumb.jpg",130,97,18);thumbnails[6605570]=new thumbnail(6605570,"37116","Collaged Nude 2, 2010.","Collage-2_thumb.jpg",130,101,18);thumbnails[6605572]=new thumbnail(6605572,"37116","Collaged Nudes, 2010.","Collage-3_thumb.jpg",130,99,18);thumbnails[6605573]=new thumbnail(6605573,"37116","Collaged Nude 3, 2010.","Collage-4_thumb.jpg",130,132,18);thumbnails[6324584]=new thumbnail(6324584,"37116","Many Heads, 2010.","Many-Heads-web_thumb.jpg",130,129,18);thumbnails[6324578]=new thumbnail(6324578,"37116","How do you exercise? #5, 2010.","How-do-you-exercise-5-web_thumb.jpg",130,136,18);thumbnails[6324574]=new thumbnail(6324574,"37116","How do you exercise? #3, 2010.","How-do-you-exercise-3-web_thumb.jpg",130,124,18);thumbnails[6324571]=new thumbnail(6324571,"37116","How do you exercise? #2, 2010.","How-do-you-exercise-2-web_thumb.jpg",130,138,18);thumbnails[6324521]=new thumbnail(6324521,"37116","How do you exercise? #1, 2010.","How-do-you-exercise-1-web_thumb.jpg",130,129,18);thumbnails[6324493]=new thumbnail(6324493,"37116","Figure Sequence, 2010.","Figure-Sequence-web_thumb.jpg",130,57,18);thumbnails[6324488]=new thumbnail(6324488,"37116","Bodies, 2010.","Bodies-web_thumb.jpg",130,132,18);thumbnails[6324439]=new thumbnail(6324439,"37116","2 Heads, 2010.","2-Heads-web_thumb.jpg",130,130,18);thumbnails[4684190]=new thumbnail(4684190,"37116","Male Triptcyh, 2009.","Male-Leafy-Triptych_thumb.jpg",130,57,18);thumbnails[4325808]=new thumbnail(4325808,"37116","Untitled Nude, 2009.","Flower-Nude-1_thumb.jpg",130,173,18);thumbnails[4325805]=new thumbnail(4325805,"37116","Untitled Nude, 2009.","Blue-Nude-1_thumb.jpg",130,191,18);thumbnails[3863396]=new thumbnail(3863396,"37116","Two Nude Sketch, 2009.","Two-Nude-Sketch_thumb.jpg",130,98,18);thumbnails[3863394]=new thumbnail(3863394,"37116","The Chair and The Nude, 2009.","The-Chair-and-The-Nude_thumb.jpg",130,178,18);thumbnails[1902823]=new thumbnail(1902823,"37116","Male Nude #2, 2008.","SC-PR-M2_thumb.jpg",130,93,18);thumbnails[1902827]=new thumbnail(1902827,"37116","Male Nude #3, 2008.","SC-PR-M3_thumb.jpg",130,92,18);thumbnails[6605574]=new thumbnail(6605574,"37117","Man Sitting and Thinking, 2010.","Drawing-of-a-man_thumb.jpg",130,181,18);thumbnails[4651225]=new thumbnail(4651225,"37117","Play Ball, 2009.","Ball_thumb.jpg",130,91,18);thumbnails[4097906]=new thumbnail(4097906,"37117","Two Women Sitiing, 2009.","Two-Women-Sitting_thumb.jpg",130,173,18);thumbnails[4097908]=new thumbnail(4097908,"37117","Two Women Standing, 2009.","Two-Women-Standing_thumb.jpg",130,185,18);thumbnails[4097897]=new thumbnail(4097897,"37117","Man Standing, 2009.","Man-Standing_thumb.jpg",130,217,18);thumbnails[4097894]=new thumbnail(4097894,"37117","Leaning Man, 2009.","Leaning-Man_thumb.jpg",130,179,18);thumbnails[4097914]=new thumbnail(4097914,"37117","Woman Sitting Down, 2009.","Woman-Sitting-Down_thumb.jpg",130,210,18);thumbnails[4097892]=new thumbnail(4097892,"37117","Leaning Back Woman, 2009.","Leaning-Back-Woman_thumb.jpg",130,190,18);thumbnails[4097861]=new thumbnail(4097861,"37117","Leaning Back, 2009.","Leaning-Back_thumb.jpg",130,174,18);thumbnails[4097848]=new thumbnail(4097848,"37117","Crossed Legged, 2009.","Crossed-Legged_thumb.jpg",130,184,18);thumbnails[4097841]=new thumbnail(4097841,"37117","Couple, 2009.","Couple_thumb.jpg",130,92,18);thumbnails[4097836]=new thumbnail(4097836,"37117","Resting, 2009.","At-Rest_thumb.jpg",130,179,18);thumbnails[6325271]=new thumbnail(6325271,"350752","S, 2010.","S_thumb.jpg",130,91,18);thumbnails[6325289]=new thumbnail(6325289,"350752","Kat, 2010.","Kat_thumb.jpg",130,59,18);thumbnails[6447894]=new thumbnail(6447894,"355762","","Handmade-Books_thumb.jpg",130,53,18);var galleries=new Object();galleries[37113]=new gallery(37113,"4651224","Paintings","gallery",[4651224,4684203,3846794,3846791,2832771,2832802,2832803,2808266,2808267,2832800,2808269,2808272,2832673,2548670,2548673,2548675,2548677,779857,779860]);galleries[37116]=new gallery(37116,"6605573","Original Prints","gallery",[5921022,6605567,6605570,6605572,6605573,6324584,6324578,6324574,6324571,6324521,6324493,6324488,6324439,4684190,4325808,4325805,3863396,3863394,1902823,1902827]);galleries[37117]=new gallery(37117,"6605574","Drawings","gallery",[6605574,4651225,4097906,4097908,4097897,4097894,4097914,4097892,4097861,4097848,4097841,4097836]);galleries[350752]=new gallery(350752,"6325271","Sculpture","gallery",[6325271,6325289]);galleries[355762]=new gallery(355762,"6447894","Handmade Sketch and Note Books","gallery",[6447894]);var imageSets=new Object();imageSets[1]="6605573,6605572,6605567,6447894,6325289,6325271,6324584,6324571,6324521,6324493,6324488,5921022,4684203,4684190,4651225,4651224,4325808,4097914,4097906,4097897,3863396,3846794,2832803,2832802,2832771,2808272,2808266,2548673,2548670,1902827,779860,779857";imageSets[2]="6605574,6605573,6447894,6325271,4651224";imageSets[3]="4651224";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/KerryDay/images";break}switch(a){case 1:b="http://www1.clikpic.com/KerryDay/images";break}switch(a){case 2:b="http://admin.clikpic.com/KerryDay/images";break}switch(a){case 24:b="http://tpc15/clikpic/KerryDay/images";break}switch(a){case 4:b="http://www.clikchurch.com/KerryDay/images";break}switch(a){case 5:b="http://www2.clikpic.com/KerryDay/images";break}switch(a){case 22:b="http://tpc5/clikpic/KerryDay/images";break}switch(a){case 23:b="http://tpc10/clikpic/KerryDay/images";break}switch(a){case 25:b="http://tpc16/clikpic/KerryDay/images";break}switch(a){case 15:b="http://www3.clikpic.com/KerryDay/images";break}switch(a){case 18:b="http://www4.clikpic.com/KerryDay/images";break}switch(a){case 19:b="http://www5.clikpic.com/KerryDay/images";break}switch(a){case 31:b="http://www7.clikpic.com/KerryDay/images";break}switch(a){case 32:b="http://admin2.clikpic.com/KerryDay/images";break}switch(a){case 33:b="http://www8.clikpic.com/KerryDay/images";break}switch(a){case 34:b="http://www9.clikpic.com/KerryDay/images";break}switch(a){case 35:b="http://admin3.clikpic.com/KerryDay/images";break}switch(a){case 37:b="http://admin4.clikpic.com/KerryDay/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="'+escape(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="Kerry Day: "+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="kerryday@blueyonder.co.uk">';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="kerryday@blueyonder.co.uk">';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+'")'})}}};