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[2008449]=new thumbnail(2008449,"274463","Pool reflections","pool reflection hammerite_thumb.JPG",130,177,18);thumbnails[2599310]=new thumbnail(2599310,"274463","Chrysanth","Crysanth_thumb.jpg",130,153,18);thumbnails[4797143]=new thumbnail(4797143,"274463","Stones throw","1531095-1-stones-throw1_thumb.jpg",130,98,18);thumbnails[6460611]=new thumbnail(6460611,"274463","Touching the water","Touching__the_water_thumb.jpg",130,96,18);thumbnails[6460680]=new thumbnail(6460680,"274463","Butch","Butch1_thumb.jpg",130,98,18);thumbnails[6460683]=new thumbnail(6460683,"274463","Koi in pool","Koi_in_pool1_thumb.jpg",130,98,18);thumbnails[6460690]=new thumbnail(6460690,"274463","Koi in reflected pool ","Koi_in_reflected_pool_thumb.jpg",130,173,18);thumbnails[6460698]=new thumbnail(6460698,"78846","Teddy and Wellies","Teddy_and_Wellies1_thumb.jpg",130,173,18);thumbnails[6460708]=new thumbnail(6460708,"274463","Touched and Untouched","Touched_-_Untouched1_thumb.jpg",130,98,18);thumbnails[4418053]=new thumbnail(4418053,"78713","Young Blue","Young_Blue_thumb.jpg",130,172,18);thumbnails[6460582]=new thumbnail(6460582,"274463","Juene Coq","Juene_Coq_thumb.jpg",130,119,18);thumbnails[6460701]=new thumbnail(6460701,"78846","Tidal Pool","Tidal_Pool1_thumb.jpg",130,204,18);thumbnails[6460716]=new thumbnail(6460716,"78846","Tranquility","Tranquility1_thumb.jpg",130,194,18);thumbnails[6682236]=new thumbnail(6682236,"78713","Forest","Forest_-_clikpic_small_thumb.jpg",130,130,18);thumbnails[6460672]=new thumbnail(6460672,"78846","Beached boats","Beached_boats12_thumb.jpg",130,194,18);thumbnails[6682244]=new thumbnail(6682244,"78713","Jenny in grey","Jenny_in_grey_-clikpic_small_thumb.jpg",130,166,18);thumbnails[5892158]=new thumbnail(5892158,"78713","Bus stop, Liverpool","Bus_stop_Liverpool_XXX_thumb.jpg",130,167,18);thumbnails[5894408]=new thumbnail(5894408,"78846","Finders","Finders_1_thumb.jpg",130,99,18);thumbnails[5894537]=new thumbnail(5894537,"78846","the pickpocket","The_Pickpocket_thumb.jpg",130,96,18);thumbnails[6682149]=new thumbnail(6682149,"78713","Jenny No. 10","Jenny_10_-clikpic_small_thumb.jpg",130,185,18);thumbnails[1059482]=new thumbnail(1059482,"78713","Anna","Anna_thumb.JPG",130,173,18);thumbnails[5894545]=new thumbnail(5894545,"78846","Umbrellas","umbrellas_thumb.jpg",130,98,18);thumbnails[6460695]=new thumbnail(6460695,"78846","Rock Pool","Rock_Pool1_thumb.jpg",130,173,18);thumbnails[6682231]=new thumbnail(6682231,"78713","Cornfield","Cornfield_clikpic_small_thumb.jpg",130,129,18);thumbnails[5892198]=new thumbnail(5892198,"78713","Sunset over Tesco","Sunset_over_Tesco_XXX_thumb.jpg",130,86,18);thumbnails[5894567]=new thumbnail(5894567,"78846","After the Fall","After_the_Fall_thumb.jpg",130,134,18);thumbnails[6682283]=new thumbnail(6682283,"78713","Jenny No. 2","Jenny_2_-_clickpic_small_thumb.jpg",130,132,18);thumbnails[6690204]=new thumbnail(6690204,"78713","Jenny reclining","Jenny_reclining_thumb.jpg",130,107,18);thumbnails[2006978]=new thumbnail(2006978,"78846","Cornwall Bay","Cornwall bay_thumb.JPG",130,76,18);thumbnails[2141551]=new thumbnail(2141551,"78713","First Light, Bridge Street","r bus station_thumb.jpg",130,130,18);thumbnails[3127311]=new thumbnail(3127311,"78846","team cycle race","for website 1_thumb.jpg",130,100,18);thumbnails[6682805]=new thumbnail(6682805,"78713","Unfinished portrait [jigsaw]","Jigsaw_thumb.jpg",130,129,18);thumbnails[3085980]=new thumbnail(3085980,"78846","Boy on a beach","boy-on-a-beach_thumb.jpg",130,173,18);thumbnails[6682811]=new thumbnail(6682811,"78713","Trajectory","Trajectory_thumb.jpg",130,131,18);thumbnails[1067016]=new thumbnail(1067016,"78846","the Dancers ","DSCF0980_thumb.JPG",130,87,18);thumbnails[6682286]=new thumbnail(6682286,"78713","Alice No. 6","Alice_No_6_-_clikpic_small_thumb.jpg",130,169,18);thumbnails[6683704]=new thumbnail(6683704,"78713","Alice, half-length portrait","Alice_-_half__length_portrait_thumb.jpg",130,197,18);thumbnails[1065632]=new thumbnail(1065632,"78846","Toddlers on the beach","Toddlers-on-the-beach[1]_thumb.jpg",130,70,18);thumbnails[6682731]=new thumbnail(6682731,"78713","Flame","Flame_thumb.jpg",130,130,18);thumbnails[3313934]=new thumbnail(3313934,"78846","Under the Pier","under the pier_thumb.jpg",130,180,18);thumbnails[6682262]=new thumbnail(6682262,"78713","New England","New_England_-_clikpic_small_thumb.jpg",130,96,18);thumbnails[1569248]=new thumbnail(1569248,"78846","Liverpool Crane in an Everton Sky","DSCF5584_thumb.JPG",130,98,18);thumbnails[6234149]=new thumbnail(6234149,"78713","House near Tuy, Galicia","Near_Tuy_Galicia_small_thumb.jpg",130,130,18);thumbnails[1810989]=new thumbnail(1810989,"78846","Greek sunset","Greek sunset_thumb.JPG",130,136,18);thumbnails[6682810]=new thumbnail(6682810,"78713","Kate evolving 3","Kate_evolving_-_3_thumb.jpg",130,165,18);thumbnails[2008477]=new thumbnail(2008477,"78846","Fountain ripples","Fountain ripples_thumb.JPG",130,173,18);thumbnails[5892170]=new thumbnail(5892170,"78713","A corner of Montmartre Cemtery","A_corner_of_Montmartre_Cemetery_XXX_thumb.jpg",130,128,18);thumbnails[3313967]=new thumbnail(3313967,"78846","Velodrome","Velodrome_thumb.jpg",130,180,18);thumbnails[1810979]=new thumbnail(1810979,"78846","Windy","Windy_thumb.JPG",130,133,18);thumbnails[6682808]=new thumbnail(6682808,"78713","Kate evolving 2","Kate_evolving_thumb.jpg",130,129,18);thumbnails[1062567]=new thumbnail(1062567,"78846","Red Bucket","Bucket_thumb.JPG",130,217,18);thumbnails[1065608]=new thumbnail(1065608,"78846","Spain","Spain[1]_thumb.jpg",130,159,18);thumbnails[3086008]=new thumbnail(3086008,"78846","Boys on the beach 2","two beach boys 2_thumb.jpg",130,173,18);thumbnails[3085997]=new thumbnail(3085997,"78846","red umbrella","red umbrella_thumb.jpg",130,276,18);thumbnails[1065630]=new thumbnail(1065630,"78846","Art Deco Freedom","Art Deco Freedom_thumb.JPG",130,98,18);thumbnails[1239170]=new thumbnail(1239170,"78846","beach reflections","beach reflections_thumb.JPG",130,87,18);thumbnails[3313954]=new thumbnail(3313954,"78846","Before the crash ","before the crash_thumb.jpg",130,175,18);thumbnails[4797216]=new thumbnail(4797216,"78846","ballet dancer","z_ballet_cancer_thumb.jpg",130,195,18);thumbnails[5894517]=new thumbnail(5894517,"78846","Lost Forest","Lost_Forest_thumb.jpg",130,92,18);thumbnails[3313957]=new thumbnail(3313957,"78846","Liverpool under construction 6 ","Liverpool under construction 3_thumb.jpg",130,98,18);thumbnails[6460676]=new thumbnail(6460676,"78846","Bright Water","Bright_Water12_thumb.jpg",130,98,18);thumbnails[6690182]=new thumbnail(6690182,"78713","Mike","Mike_-_clikpic_thumb.jpg",130,130,18);thumbnails[1075928]=new thumbnail(1075928,"78713","Nine figures against the sun.","Nine_thumb.JPG",130,131,18);thumbnails[1059478]=new thumbnail(1059478,"78713","Sunlight, Arbourhay.<br>\r\n","Abbourhay_thumb.jpg",130,173,18);thumbnails[1059501]=new thumbnail(1059501,"78713","Two men.<br>\r\n","Men_thumb.jpg",130,129,18);thumbnails[1059505]=new thumbnail(1059505,"78713","Landscape, storm approaching<br>\r\n","Storm_thumb.JPG",130,175,18);var galleries=new Object();galleries[78713]=new gallery(78713,"6690204,6690182,6683704,6682811,6682810,6682808,6682805,6682731,6682286,6682283","Gallery 1","gallery",[4418053,6682236,6682244,5892158,6682149,1059482,6682231,5892198,6682283,6690204,2141551,6682805,6682811,6682286,6683704,6682731,6682262,6234149,6682810,5892170,6682808,6690182,1075928,1059478,1059501,1059505]);galleries[78846]=new gallery(78846,"6460716,6460701,6460698,6460695,6460676,6460672,5894567,5894545,5894537,5894517","Gallery 2","gallery",[6460698,6460701,6460716,6460672,5894408,5894537,5894545,6460695,5894567,2006978,3127311,3085980,1067016,1065632,3313934,1569248,1810989,2008477,3313967,1810979,1062567,1065608,3086008,3085997,1065630,1239170,3313954,4797216,5894517,3313957,6460676]);galleries[274463]=new gallery(274463,"6460708,6460690,6460683,6460680,6460611,6460582,4797143,2599310,2008449","Gallery 3","gallery",[2008449,2599310,4797143,6460611,6460680,6460683,6460690,6460708,6460582]);var imageSets=new Object();imageSets[1]="6690204,6690182,6683704,6682811,6682810,6682808,6682805,6682731,6682286,6682283,6682262,6682244,6682236,6682231,6682149,6460716,6460708,6460701,6460698,6460695,6460690,6460683,6460680,6460676,6460672,6460611,6460582,6234149,5894567,5894545,5894537,5894517,5894408,5892198,5892170,5892158,4797216,4797143,4418053,3313967,3313957,3313954,3313934,3127311,3086008,3085997,3085980,2599310,2141551,2008477";imageSets[3]="6690204,6690182,6683704,6682811,6682810,6682808,6682805,6682731,6682286,6682283,6682262,6682244,6682236,6682231,6682149,6460716,6460708,6460701,6460698,6460695,6460690,6460683,6460680,6460676,6460672,6460611,6460582,6234149,5894567,5894545,5894537,5894517,5894408,5892198,5892170,5892158,4797216,4797143,4418053,3313967,3313957,3313954,3313934,3127311,3086008,3085997,3085980,2599310,2141551,2008477";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/artshedgallery/images";break}switch(a){case 1:b="http://www1.clikpic.com/artshedgallery/images";break}switch(a){case 2:b="http://admin.clikpic.com/artshedgallery/images";break}switch(a){case 24:b="http://tpc15/clikpic/artshedgallery/images";break}switch(a){case 4:b="http://www.clikchurch.com/artshedgallery/images";break}switch(a){case 5:b="http://www2.clikpic.com/artshedgallery/images";break}switch(a){case 22:b="http://tpc5/clikpic/artshedgallery/images";break}switch(a){case 23:b="http://tpc10/clikpic/artshedgallery/images";break}switch(a){case 25:b="http://tpc16/clikpic/artshedgallery/images";break}switch(a){case 15:b="http://www3.clikpic.com/artshedgallery/images";break}switch(a){case 18:b="http://www4.clikpic.com/artshedgallery/images";break}switch(a){case 19:b="http://www5.clikpic.com/artshedgallery/images";break}switch(a){case 31:b="http://www7.clikpic.com/artshedgallery/images";break}switch(a){case 32:b="http://admin2.clikpic.com/artshedgallery/images";break}switch(a){case 33:b="http://www8.clikpic.com/artshedgallery/images";break}switch(a){case 34:b="http://www9.clikpic.com/artshedgallery/images";break}switch(a){case 35:b="http://admin3.clikpic.com/artshedgallery/images";break}switch(a){case 37:b="http://admin4.clikpic.com/artshedgallery/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="Art Shed Gallery: "+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>"}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="browndshd@boltblue.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="browndshd@boltblue.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+'")'})}}};