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[1994744]=new thumbnail(1994744,"133706","CANDLELIGHT","-1250 copy1_thumb.jpg",130,168,32);thumbnails[1994849]=new thumbnail(1994849,"133706","PEBBLES","5  stones-1527_thumb.jpg",130,130,32);thumbnails[1994862]=new thumbnail(1994862,"133706","CALLA LILIES","Calla Lilies_thumb.jpg",130,164,32);thumbnails[1994872]=new thumbnail(1994872,"133713","HADRIAN'S WALL","Hadrian's Wall_thumb.jpg",130,157,32);thumbnails[1995239]=new thumbnail(1995239,"133713","NYMANS HOUSE","-1358 11_thumb.jpg",130,85,32);thumbnails[1995240]=new thumbnail(1995240,"133713","CASTLERIGG STONE CIRCLE","Castlerigg Stone Circle_thumb.jpg",130,87,32);thumbnails[1995252]=new thumbnail(1995252,"133713","CANARY WHARF","IMG_0011 B-W_thumb.jpg",130,195,32);thumbnails[1995256]=new thumbnail(1995256,"133706","BLUE STAR HYACINTH ","The Hyacinth_thumb.jpg",130,195,32);thumbnails[1995262]=new thumbnail(1995262,"133706","ORCHIDS","orchid 1-68 1_thumb.jpg",130,195,32);thumbnails[1995271]=new thumbnail(1995271,"133713","WINCHESTER CATHEDRAL SLYPE","IMG_1063_thumb.jpg",130,195,32);thumbnails[1995272]=new thumbnail(1995272,"133706","FRAGILE FLOWERS","FRAGILE FLOWERS_thumb.jpg",130,201,32);thumbnails[1995274]=new thumbnail(1995274,"133706","DICED,SLICED OR GRATED","Picture 056_thumb.jpg",130,176,32);thumbnails[1995517]=new thumbnail(1995517,"133713","PRAYING","p a new-_thumb.jpg",130,222,32);thumbnails[2016225]=new thumbnail(2016225,"133706","CAPSICUM SPLASH","Capsicum Splash_thumb.jpg",130,199,32);thumbnails[2016226]=new thumbnail(2016226,"133706","WATER GLASS","Water Glass_thumb.jpg",130,196,32);thumbnails[3205254]=new thumbnail(3205254,"133713","EGYPT-UPON BRIGHTON","IMG_0095_thumb.jpg",130,203,32);thumbnails[3205257]=new thumbnail(3205257,"133706","PANSY PATTERN","Pansy pattern_thumb.jpg",130,130,32);thumbnails[3205261]=new thumbnail(3205261,"133713","LORNA DOONE BRIDGE","LORNA DOONE BRIDGE (1)_thumb.jpg",130,222,32);thumbnails[3205265]=new thumbnail(3205265,"133713","SPINAKER TOWER< PORTSMOUTH","-1564_thumb.jpg",130,193,32);thumbnails[3205268]=new thumbnail(3205268,"133713","St. Marys Church, Walberton, West Sussex","church 3_thumb.jpg",130,94,32);thumbnails[3205274]=new thumbnail(3205274,"326845","FIRE AND ICE","-1281_thumb.jpg",130,171,32);thumbnails[3205279]=new thumbnail(3205279,"133706","CUTAWAY","IMG_0057ll_thumb.jpg",130,149,32);thumbnails[3205286]=new thumbnail(3205286,"326845","GALLERY","gallery_thumb.jpg",130,92,32);thumbnails[5027492]=new thumbnail(5027492,"133706","OYSTERS","IMG_2950_thumb.jpg",130,83,32);thumbnails[5028043]=new thumbnail(5028043,"133706","APPLE POD","apple_pod_copy_thumb.jpg",130,88,32);thumbnails[5029756]=new thumbnail(5029756,"133713","GLASS LIGHT","cat_-_2-2193_thumb.jpg",130,195,32);thumbnails[5029794]=new thumbnail(5029794,"133706","SPLASH OF RED","red__light-2205_thumb.jpg",130,195,32);thumbnails[5029803]=new thumbnail(5029803,"133905","SCAREDY CAT","-20741_thumb.jpg",130,170,32);thumbnails[5029814]=new thumbnail(5029814,"133713","E14THE SOUTH COLONNADE E14","IMG_0014_thumb.jpg",130,195,32);thumbnails[5029827]=new thumbnail(5029827,"133713","MEG","IMG_3031_thumb.jpg",130,175,32);thumbnails[5029828]=new thumbnail(5029828,"133905","De la Warr Pavilion, Bexhill, Sussex","IMG_2652-2_thumb.jpg",130,193,32);thumbnails[5029835]=new thumbnail(5029835,"326845","ROBO-DAUGHTER","IMG_3094print_thumb.jpg",130,140,32);thumbnails[5570573]=new thumbnail(5570573,"326845","TIME","new_time_thumb.jpg",130,92,32);thumbnails[5570582]=new thumbnail(5570582,"326845","VAL-HALA","VAL-HALA_thumb.jpg",130,67,32);thumbnails[5570843]=new thumbnail(5570843,"133706","PYROMANIA","pyromania_thumb.jpg",130,176,32);thumbnails[5570854]=new thumbnail(5570854,"133706","EASY PEEL","_easy_peel_thumb.jpg",130,195,32);thumbnails[5571004]=new thumbnail(5571004,"133713","BEACH AND GROYNS","beach_and_groyns_thumb.jpg",130,85,32);thumbnails[5571006]=new thumbnail(5571006,"133713","GROYNS","groyns_thumb.jpg",130,87,32);thumbnails[1995242]=new thumbnail(1995242,"133905","SANDS OF TIME","egg timer_thumb.jpg",130,195,32);thumbnails[1995507]=new thumbnail(1995507,"326845","WOODLAND WONDERLAND","woodland wonderland copy(000)_thumb.jpg",130,235,32);thumbnails[1995461]=new thumbnail(1995461,"133905","THE GREEN BAND","The Grean Band_thumb.jpg",130,195,32);thumbnails[1995235]=new thumbnail(1995235,"133905","INFINITY","-1432_thumb.jpg",130,78,32);thumbnails[1995370]=new thumbnail(1995370,"133905","UNFINISHED","Untitled-1_thumb.jpg",130,169,32);thumbnails[2007438]=new thumbnail(2007438,"133905","SMOKING","tri frame 05_thumb.jpg",130,92,32);thumbnails[1995253]=new thumbnail(1995253,"133905","PAPER CUT","The Sharp Cut_thumb.jpg",130,39,32);thumbnails[1994182]=new thumbnail(1994182,"133682","STONEHENGE","STONEHENGE_thumb.jpg",130,65,32);thumbnails[1994831]=new thumbnail(1994831,"133682","AUTUMN SEA","AUTUMN SEA_thumb.jpg",130,87,32);thumbnails[1994866]=new thumbnail(1994866,"133682","EBBING LIGHT","EBBING LIGHT_thumb.jpg",130,155,32);thumbnails[1995233]=new thumbnail(1995233,"133682","BEACH","IMG_0259 beach_thumb.jpg",130,87,32);thumbnails[1995238]=new thumbnail(1995238,"133682","SPINAKER TOWER","_MG_0623 01_thumb.jpg",130,185,32);thumbnails[1995243]=new thumbnail(1995243,"133682","BOULOGNES CATHEDRAL OF NOTRE DAME VIEWED FROM THE 'RUE DE LILLE'","BOULOGNE'S CATHEDRAL OF NOTRE-DAME, VIEWED FROM THE RUE DE LILLE_thumb..jpg",130,184,32);thumbnails[1995246]=new thumbnail(1995246,"133682","DOGGONE","DOG GONE_thumb.jpg",130,87,32);thumbnails[1995476]=new thumbnail(1995476,"133682","LORNA DOONE BRIDGE","LORNA DOONE BRIDGE_thumb.jpg",130,221,32);thumbnails[1995490]=new thumbnail(1995490,"133682","SEASCAPE","SEASCAPE(000)_thumb.jpg",130,30,32);thumbnails[3205271]=new thumbnail(3205271,"133682","EL BALCON, SPANE","-1718_thumb.jpg",130,85,32);thumbnails[5028018]=new thumbnail(5028018,"133682","WINTER MEADOW","-2254-2_thumb.jpg",130,70,32);thumbnails[5029961]=new thumbnail(5029961,"133682","CAUTION CYCLISTS","-2244_thumb.jpg",130,82,32);thumbnails[5029986]=new thumbnail(5029986,"133682","BARBED","cat_-_2-2282-21_thumb.jpg",130,179,32);thumbnails[5570867]=new thumbnail(5570867,"133682","LESDGERS LANE","ledgers_lane_thumb.jpg",130,87,32);thumbnails[2007133]=new thumbnail(2007133,"134507","","01 jan08 artvert1_thumb.jpg",130,184,32);thumbnails[2007135]=new thumbnail(2007135,"134507","","02 feb08 horiz1_thumb.jpg",130,184,32);thumbnails[2007257]=new thumbnail(2007257,"134507","","03 mar08 horiz1_thumb.jpg",130,184,32);thumbnails[2007136]=new thumbnail(2007136,"134507","","04 apr08 artvert_thumb.jpg",130,184,32);thumbnails[2007141]=new thumbnail(2007141,"134507","","05 may08 artvert_thumb.jpg",130,184,32);thumbnails[2007143]=new thumbnail(2007143,"134507","","06 jun08 artvert_thumb.jpg",130,184,32);thumbnails[2007144]=new thumbnail(2007144,"134507","","07 jul08 artvert_thumb.jpg",130,184,32);thumbnails[2007149]=new thumbnail(2007149,"134507","","08 aug08 artvert_thumb.jpg",130,184,32);thumbnails[2007195]=new thumbnail(2007195,"134507","","09 sep08 arthoriz1_thumb.jpg",130,184,32);thumbnails[2007196]=new thumbnail(2007196,"134507","","10 oct08 artvert_thumb.jpg",130,184,32);thumbnails[2007198]=new thumbnail(2007198,"134507","","11 nov08 arthoriz_thumb.jpg",130,184,32);thumbnails[2007200]=new thumbnail(2007200,"134507","","12 dec08 artvert_thumb.jpg",130,184,32);thumbnails[2007116]=new thumbnail(2007116,"134507","","00 cover artvert1_thumb.jpg",130,184,32);var galleries=new Object();galleries[133905]=new gallery(133905,"5029828,5029803,2007438,1995461,1995370,1995253,1995242,1995235","ABSTRACT","gallery",[5029803,5029828,1995242,1995461,1995235,1995370,2007438,1995253]);galleries[326845]=new gallery(326845,"5570582,5570573,5029835,3205286,3205274,1995507","FANTASY","gallery",[3205274,3205286,5029835,5570573,5570582,1995507]);galleries[133713]=new gallery(133713,"5571006,5571004,5029827,5029814,5029756,3205268,3205265,3205261,3205254,1995517","Monochrome","gallery",[1994872,1995239,1995240,1995252,1995271,1995517,3205254,3205261,3205265,3205268,5029756,5029814,5029827,5571004,5571006]);galleries[133706]=new gallery(133706,"5570854,5570843,5029794,5028043,5027492,3205279,3205257,2016226,2016225,1995274","Still Life","gallery",[1994744,1994849,1994862,1995256,1995262,1995272,1995274,2016225,2016226,3205257,3205279,5027492,5028043,5029794,5570843,5570854]);galleries[133682]=new gallery(133682,"5570867,5029986,5029961,5028018,3205271,1995490,1995476,1995246,1995243,1995238","Landscape","gallery",[1994182,1994831,1994866,1995233,1995238,1995243,1995246,1995476,1995490,3205271,5028018,5029961,5029986,5570867]);galleries[134507]=new gallery(134507,"2007257,2007200,2007198,2007196,2007195,2007149,2007144,2007143,2007141,2007136","CALENDAR","gallery",[2007133,2007135,2007257,2007136,2007141,2007143,2007144,2007149,2007195,2007196,2007198,2007200,2007116]);var imageSets=new Object();imageSets[1]="3205286,2016226,2016225,2007438,1995274,1995253,1995246,1995243,1995240,1995239,1995238,1995235,1995233,1994866,1994862,1994849,1994831,1994744";imageSets[3]="5571006,5571004,5570867,5570854,5570843,5570582,5570573,5029986,5029961,5029835,5029828,5029827,5029814,5029803,5029794,5029756,5028043,5028018,5027492,3205286,3205279,3205274,3205271,3205268,3205265,3205261,3205257,3205254,2016226,2016225,2007438,2007257,2007200,2007198,2007196,2007195,2007149,2007144,2007143,2007141,2007136,2007135,2007133,2007116,1995517,1995507,1995490,1995476,1995461,1995370";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/daveybaby/images";break}switch(a){case 1:b="http://www1.clikpic.com/daveybaby/images";break}switch(a){case 2:b="http://admin.clikpic.com/daveybaby/images";break}switch(a){case 24:b="http://tpc15/clikpic/daveybaby/images";break}switch(a){case 4:b="http://www.clikchurch.com/daveybaby/images";break}switch(a){case 5:b="http://www2.clikpic.com/daveybaby/images";break}switch(a){case 22:b="http://tpc5/clikpic/daveybaby/images";break}switch(a){case 23:b="http://tpc10/clikpic/daveybaby/images";break}switch(a){case 25:b="http://tpc16/clikpic/daveybaby/images";break}switch(a){case 15:b="http://www3.clikpic.com/daveybaby/images";break}switch(a){case 18:b="http://www4.clikpic.com/daveybaby/images";break}switch(a){case 19:b="http://www5.clikpic.com/daveybaby/images";break}switch(a){case 31:b="http://www7.clikpic.com/daveybaby/images";break}switch(a){case 32:b="http://admin2.clikpic.com/daveybaby/images";break}switch(a){case 33:b="http://www8.clikpic.com/daveybaby/images";break}switch(a){case 34:b="http://www9.clikpic.com/daveybaby/images";break}switch(a){case 35:b="http://admin3.clikpic.com/daveybaby/images";break}switch(a){case 37:b="http://admin4.clikpic.com/daveybaby/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=" DAVID REES-PESKETT: "+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="reespeskett@btinternet.com">';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="reespeskett@btinternet.com">';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+'")'})}}};