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[2163540]=new thumbnail(2163540,"","Portobello Mushroom #2, 2005","web-2_thumb.jpg",130,93,32);thumbnails[2163503]=new thumbnail(2163503,"","Grass #2,2006","web-4_thumb.jpg",130,89,32);thumbnails[3666389]=new thumbnail(3666389,"","Aubergines on a plate II, 2009","cropped-aubergine-6_thumb.jpg",130,101,32);thumbnails[2163425]=new thumbnail(2163425,"","Transient Form, 2007","web-8_thumb.jpg",130,130,32);thumbnails[3153783]=new thumbnail(3153783,"","Beetroot, 2008","RIMG8334_thumb.jpg",130,127,32);thumbnails[3666247]=new thumbnail(3666247,""," aubergines on a plate IV, 2009. ","cropped-aubergine-1_thumb.jpg",130,130,32);thumbnails[2386364]=new thumbnail(2386364,"","Degree Show, Reading, June 2008","RIMG7452_thumb.jpg",130,98,32);thumbnails[3666378]=new thumbnail(3666378,""," aubergines on a plate V, 2009","cropped-aubergine-2_thumb.jpg",130,129,32);thumbnails[5557448]=new thumbnail(5557448,"142470","Rooster I","DSC00759_05AC2BC4-24E8-5EC4-4F79DF47D158322F_thumb.jpg",130,149,32);thumbnails[5557456]=new thumbnail(5557456,"142470","Rooster II","DSC00761_05AD6437-24E8-5EC4-4FEB1545ED86FB1C_thumb.jpg",130,149,32);thumbnails[5557462]=new thumbnail(5557462,"142470","Pears in bowl I","DSC00762_05AE54C2-24E8-5EC4-4F471926EEA0C8AC_thumb.jpg",130,157,32);thumbnails[5557467]=new thumbnail(5557467,"142470","Pears in bowl II","DSC00763_thumb.jpg",130,167,32);thumbnails[5557470]=new thumbnail(5557470,"142470","Pears III ","DSC00764_thumb.jpg",130,160,32);thumbnails[3153715]=new thumbnail(3153715,"142470","Reading's Legacy","rimg2403-(2)_thumb.jpg",130,85,32);thumbnails[3153721]=new thumbnail(3153721,"142470","Legacy of Reading","rimg2404-(2)_thumb.jpg",130,83,32);thumbnails[2163445]=new thumbnail(2163445,"142470"," Beer , Bulbs and biscuits, 2007","web-5_thumb.jpg",130,187,32);thumbnails[2245427]=new thumbnail(2245427,"142470","Apricot Still Life #1, 2008","reduced-for-print-photo-mon2_thumb.jpg",130,85,32);thumbnails[2245279]=new thumbnail(2245279,"142470","16 Stills from Apricot Still Life #1, 2008","penny-front-card-08-larger_thumb.jpg",130,95,32);thumbnails[3931091]=new thumbnail(3931091,"142470","Apple Blossom I, 2009","apple-blossom-I_thumb.jpg",130,87,32);thumbnails[3931096]=new thumbnail(3931096,"142470","Apple Blossom II, 2009","apple-blossom-II_thumb.jpg",130,87,32);thumbnails[3931102]=new thumbnail(3931102,"142470","Apple Blossom III, 2009","apple-blossom-III_thumb.jpg",130,87,32);thumbnails[3153706]=new thumbnail(3153706,"142470","Winter fruit","RIMG1168_thumb.jpg",130,173,32);thumbnails[3184348]=new thumbnail(3184348,"142470","Totem-pole","RIMG8407_thumb.jpg",130,202,32);thumbnails[5557473]=new thumbnail(5557473,"142470","Lion in the half light","lion-desaturated_05B19F0F-24E8-5EC4-4F4191231B0475C8_thumb.jpg",130,111,32);thumbnails[5583735]=new thumbnail(5583735,"193272","In a state of Flux ( 2010)","dsc02134-2_thumb.jpg",130,132,32);thumbnails[2163286]=new thumbnail(2163286,"193272","Apricot Still life #4, 2008","web-26_thumb.jpg",130,84,32);thumbnails[2163296]=new thumbnail(2163296,"193272","Apricot Still life #5","web-27_thumb.jpg",130,83,32);thumbnails[2163299]=new thumbnail(2163299,"193272","Apricot Still life #6","web-28_thumb.jpg",130,86,32);thumbnails[3153749]=new thumbnail(3153749,"193272","Still life study #1 2008","RIMG8299_thumb.jpg",130,131,32);thumbnails[2253982]=new thumbnail(2253982,"193272","Study for garden landscape, 2007","RIMG7206_thumb.jpg",130,179,32);thumbnails[2253927]=new thumbnail(2253927,"193272","life drawing #2, 2006","RIMG7203_thumb.jpg",130,99,32);thumbnails[2253932]=new thumbnail(2253932,"193272","life drawing #3, 2006","RIMG7213_thumb.jpg",130,189,32);thumbnails[2163248]=new thumbnail(2163248,"143402","Suspended Form, 2008<br>\r\nCopper, steel and silk laps, suspended from 1mx1m Canvas over mirror.","web-24_thumb.jpg",130,161,32);thumbnails[2163226]=new thumbnail(2163226,"143402","Suspended Form, 2008<br>\r\nview of reflection into mirror.","web-23_thumb.jpg",130,119,32);thumbnails[2163391]=new thumbnail(2163391,"143402","Chicken #3, 2007","web-9_thumb.jpg",130,127,32);thumbnails[2163396]=new thumbnail(2163396,"143402","Clay Chicken","web-11_thumb.jpg",130,173,32);thumbnails[2163376]=new thumbnail(2163376,"143402","Chicken #2, 2007","web-10_thumb.jpg",130,127,32);thumbnails[2163469]=new thumbnail(2163469,"143402","Suspended Hens, 2007","web-20_thumb.jpg",130,308,32);thumbnails[2304368]=new thumbnail(2304368,"143402","Still Life, 2008","RIMG7408_thumb.jpg",130,173,32);thumbnails[2163449]=new thumbnail(2163449,"143402","Tin biscuits,  2007","web-6_thumb.jpg",130,52,32);thumbnails[2163454]=new thumbnail(2163454,"143402","The legacy of Reading #3, 2007","web-13_thumb.jpg",130,98,32);thumbnails[3153743]=new thumbnail(3153743,"143402","Chair, 2006","RIMG8289_thumb.jpg",130,173,32);thumbnails[2163399]=new thumbnail(2163399,"143402","Legacy, 2007","web-12_thumb.jpg",130,132,32);thumbnails[2163188]=new thumbnail(2163188,"143402","Still from Rotating copper form, 2008","web-18_thumb.jpg",130,130,32);thumbnails[2245416]=new thumbnail(2245416,"143402","2nd Still from Rotating Copper form, 2008","web-19_thumb.jpg",130,130,32);thumbnails[2245491]=new thumbnail(2245491,"143402","3rd Still from Rotating Copper form, 2008","web-21_thumb.jpg",130,130,32);thumbnails[2163534]=new thumbnail(2163534,"194806","Portobello Mushroom #1, 2005","web-14_thumb.jpg",130,92,32);thumbnails[3153711]=new thumbnail(3153711,"194806","Still Life ( after the Toilet of Venus), 2006.","rimg0031-(2)_thumb.jpg",130,184,32);thumbnails[2163522]=new thumbnail(2163522,"194806","Apricots and peaches ,2006","web-15_thumb.jpg",130,127,32);thumbnails[2163125]=new thumbnail(2163125,"194806","Apricot Still Life #2, 2008","reduced for web_thumb.JPG",130,85,32);thumbnails[2163138]=new thumbnail(2163138,"194806","Apricot Still Life #3, 2008","web-30_thumb.jpg",130,85,32);thumbnails[3931303]=new thumbnail(3931303,"194806","Aubergines on a plate I, 2009","aubergines-on-plate-I_thumb.jpg",130,106,32);thumbnails[3666383]=new thumbnail(3666383,"194806"," aubergines on a plate III, 2009","cropped-aubergine-5_thumb.jpg",130,103,32);thumbnails[3666396]=new thumbnail(3666396,"194806","Aubergines on a plate VI, 2009","cropped-aubergine-on-paper_thumb.jpg",130,130,32);thumbnails[3666379]=new thumbnail(3666379,"194806","Aubergines on a plate VII. 2009","cropped-aubergine-3_thumb.jpg",130,131,32);thumbnails[3666381]=new thumbnail(3666381,"194806","Aubergines on a plate VIII, 2009","cropped-aubergine-4_thumb.jpg",130,129,32);thumbnails[3931122]=new thumbnail(3931122,"194806","Rhubarb study on paper, 2009","study-on-paper-of-rhubarb_thumb.jpg",130,118,32);thumbnails[5584161]=new thumbnail(5584161,"194806","Oranges in pink bowl 2009","oranges-in-pink-bowl-3-rep_thumb.jpg",130,129,32);thumbnails[3666255]=new thumbnail(3666255,"194806","Autumn pears in bowl, 2008","Autumn-pears-repainted_thumb.jpg",130,125,32);thumbnails[3184175]=new thumbnail(3184175,"194806","Autumn pears, 2008","cropped-pears_thumb.jpg",130,96,32);thumbnails[3184178]=new thumbnail(3184178,"194806","Pears in bowl, 2008","cropped-pears-in-bowl_thumb.jpg",130,176,32);thumbnails[3931252]=new thumbnail(3931252,"194806","Oranges in pink bowl, 2009","oranges-in-pink-bowl-I_thumb.jpg",130,124,32);thumbnails[2163312]=new thumbnail(2163312,"143374","Winter garden, 2008","rimg7130-(2)_thumb.jpg",130,116,32);thumbnails[2163322]=new thumbnail(2163322,"143374","Garden Landscape, 2007","web-16_thumb.jpg",130,173,32);thumbnails[2163491]=new thumbnail(2163491,"143374","Grass #1, 2006","web-3_thumb.jpg",130,157,32);thumbnails[2163419]=new thumbnail(2163419,"143374","Garden Landscape #2 2007","web-7_thumb.jpg",130,126,32);thumbnails[4086419]=new thumbnail(4086419,"143374","Poppies I","RIMG7194_thumb.jpg",130,182,32);thumbnails[4086430]=new thumbnail(4086430,"143374","Poppies II","RIMG7192_thumb.jpg",130,183,32);var galleries=new Object();galleries[142470]=new gallery(142470,"3153706,2245279","Print","gallery",[5557448,5557456,5557462,5557467,5557470,3153715,3153721,2163445,2245427,2245279,3931091,3931096,3931102,3153706,3184348,5557473]);galleries[193272]=new gallery(193272,"5583735","Drawings","gallery",[5583735,2163286,2163296,2163299,3153749,2253982,2253927,2253932]);galleries[143402]=new gallery(143402,"2163469,2163396","3 Dimensional work","gallery",[2163248,2163226,2163391,2163396,2163376,2163469,2304368,2163449,2163454,3153743,2163399,2163188,2245416,2245491]);galleries[194806]=new gallery(194806,"3666396,3666379,2163534","Painting:Still Life","gallery",[2163534,3153711,2163522,2163125,2163138,3931303,3666383,3666396,3666379,3666381,3931122,5584161,3666255,3184175,3184178,3931252]);galleries[143374]=new gallery(143374,"2163419","Painting : Landscape","gallery",[2163312,2163322,2163491,2163419,4086419,4086430]);var imageSets=new Object();imageSets[1]="5583735,3666396,3666381,3666379,3153749,3153721,3153715,3153706,2245279,2163534,2163449,2163445,2163419,2163312,2163226,2163138";imageSets[2]="5583735,3666396,3666379,3153706,2245279,2163534,2163469,2163419,2163396";imageSets[3]="5584161,5583735,5557473,5557470,5557467,5557462,5557456,5557448,4086430,4086419,3931303,3931252,3931122,3931102,3931096,3931091,3666396,3666389,3666383,3666381,3666379,3666378,3666255,3666247,3184348,3184178,3184175,3153783,3153749,3153743,3153721,3153715,3153711,3153706,2386364,2304368,2253982,2253932,2253927,2245491,2245427,2245416,2245279,2163540,2163534,2163522,2163503,2163491,2163469,2163454";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/pennyadamson/images";break}switch(a){case 1:b="http://www1.clikpic.com/pennyadamson/images";break}switch(a){case 2:b="http://admin.clikpic.com/pennyadamson/images";break}switch(a){case 24:b="http://tpc15/clikpic/pennyadamson/images";break}switch(a){case 4:b="http://www.clikchurch.com/pennyadamson/images";break}switch(a){case 5:b="http://www2.clikpic.com/pennyadamson/images";break}switch(a){case 22:b="http://tpc5/clikpic/pennyadamson/images";break}switch(a){case 23:b="http://tpc10/clikpic/pennyadamson/images";break}switch(a){case 25:b="http://tpc16/clikpic/pennyadamson/images";break}switch(a){case 15:b="http://www3.clikpic.com/pennyadamson/images";break}switch(a){case 18:b="http://www4.clikpic.com/pennyadamson/images";break}switch(a){case 19:b="http://www5.clikpic.com/pennyadamson/images";break}switch(a){case 31:b="http://www7.clikpic.com/pennyadamson/images";break}switch(a){case 32:b="http://admin2.clikpic.com/pennyadamson/images";break}switch(a){case 33:b="http://www8.clikpic.com/pennyadamson/images";break}switch(a){case 34:b="http://www9.clikpic.com/pennyadamson/images";break}switch(a){case 35:b="http://admin3.clikpic.com/pennyadamson/images";break}switch(a){case 37:b="http://admin4.clikpic.com/pennyadamson/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="Penny Adamson - Artist: "+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+'")'})}}};
