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[983420]=new thumbnail(983420,"73841","Ice - Currently for sale via The Gallery on the Green.","Ice_thumb.jpg",130,199,15);thumbnails[3533985]=new thumbnail(3533985,"214482","Elephant","Elephant_thumb.jpg",130,154,15);thumbnails[3533988]=new thumbnail(3533988,"73840","Four to Doomsday","four-to-Doomsday_thumb.jpg",130,91,15);thumbnails[3533989]=new thumbnail(3533989,"73841","Lucifer Box","JSS-Lucifer_thumb.jpg",130,185,15);thumbnails[3533992]=new thumbnail(3533992,"214482","Kitty","Kitty-Ds_thumb.jpg",130,160,15);thumbnails[3533993]=new thumbnail(3533993,"214482","Kitty Wireframe","low_poly_kitty_wireframe_thumb.jpg",130,169,15);thumbnails[3533994]=new thumbnail(3533994,"73842","Tardis Interior Concept ","new_tardis_interior_thumb.jpg",130,74,15);thumbnails[3533996]=new thumbnail(3533996,"73840","Series 4","NEW-SERIES-4-a_thumb.jpg",130,91,15);thumbnails[3533999]=new thumbnail(3533999,"73842","Sontaran","New-sont_thumb.jpg",130,163,15);thumbnails[3534002]=new thumbnail(3534002,"214481","Book","PAGE_thumb.jpg",130,178,15);thumbnails[3534003]=new thumbnail(3534003,"73839","Future Shock","page1_thumb.jpg",130,170,15);thumbnails[3534005]=new thumbnail(3534005,"73839","Future Shock 2","page-3_thumb.jpg",130,170,15);thumbnails[3534006]=new thumbnail(3534006,"73840","SJA","SJA_thumb.jpg",130,91,15);thumbnails[3534007]=new thumbnail(3534007,"73838","Tank Girl","tankg_thumb.jpg",130,173,15);thumbnails[3534013]=new thumbnail(3534013,"73838","Tank Girl Sketch","tanky_thumb.jpg",130,173,15);thumbnails[3534033]=new thumbnail(3534033,"73839","batman","batman_thumb.jpg",130,197,15);thumbnails[3534034]=new thumbnail(3534034,"73839","dredd","dredd_thumb.jpg",130,170,15);thumbnails[3775881]=new thumbnail(3775881,"73839","Traffic","traffic_thumb.jpg",130,197,15);thumbnails[3775884]=new thumbnail(3775884,"214481","talk talk","talk_thumb.jpg",130,183,15);thumbnails[3775890]=new thumbnail(3775890,"73839","Mega- city shoot-out","shootout_thumb.jpg",130,189,15);thumbnails[3775909]=new thumbnail(3775909,"73839","Rassilon","rassilon_thumb.jpg",130,189,15);thumbnails[3775913]=new thumbnail(3775913,"73839","part inked","part-inked_thumb.jpg",130,179,15);thumbnails[3775916]=new thumbnail(3775916,"73839","model","Model_thumb.jpg",130,172,15);thumbnails[3775925]=new thumbnail(3775925,"73842","Animated Strontium Dog Character","Johnny_Alpha_animated_thumb.jpg",130,231,15);thumbnails[3775928]=new thumbnail(3775928,"73841","Jagged","Jagged_Alliance_thumb.jpg",130,117,15);thumbnails[3775932]=new thumbnail(3775932,"73840","Image of Fendahl","Image-of-the-Fendahl_thumb.jpg",130,91,15);thumbnails[3775936]=new thumbnail(3775936,"73839","Gunfight","gunfight_thumb.jpg",130,197,15);thumbnails[3775941]=new thumbnail(3775941,"214481","fire","fire_thumb.jpg",130,144,15);thumbnails[3775945]=new thumbnail(3775945,"73838","Female Robin","female-robin_thumb.jpg",130,179,15);thumbnails[3775950]=new thumbnail(3775950,"73839","Lawmaster","bike_thumb.jpg",130,196,15);thumbnails[3927193]=new thumbnail(3927193,"73838","2000AD cover rough","Rough_stronty_cover_thumb.jpg",130,174,15);thumbnails[3927196]=new thumbnail(3927196,"73842","Ice Warrior","ice_warrior_thumb.jpg",130,174,15);thumbnails[3927198]=new thumbnail(3927198,"214481","the man who fell to earth","stars_thumb.jpg",130,184,15);thumbnails[3927200]=new thumbnail(3927200,"73841","SUV","suv_thumb.jpg",130,92,15);thumbnails[3927201]=new thumbnail(3927201,"214481","Jack's Back","Jacks_back_thumb.jpg",130,184,15);thumbnails[4365405]=new thumbnail(4365405,"214481","Pity the gelth","Pity_the_gelth_thumb.jpg",130,178,15);thumbnails[4365464]=new thumbnail(4365464,"214481","Haunted","haunted_thumb.jpg",130,178,15);thumbnails[4365465]=new thumbnail(4365465,"214481","Hot eye","hot_eyes_thumb.jpg",130,178,15);thumbnails[4365467]=new thumbnail(4365467,"214481","Join us","join_us_thumb.jpg",130,178,15);thumbnails[4365468]=new thumbnail(4365468,"214481","skulls","skulls_thumb.jpg",130,178,15);thumbnails[4365469]=new thumbnail(4365469,"73839","sick","sick_thumb.jpg",130,170,15);thumbnails[4365470]=new thumbnail(4365470,"73839","party","page1_1_thumb.jpg",130,170,15);thumbnails[5094277]=new thumbnail(5094277,"73841","First CD of the new Tom Baker audio plays","1_Stuff-of-nightmares1_thumb.jpg",130,130,15);thumbnails[5094289]=new thumbnail(5094289,"73841","Dead shoes (second CD)","2_deadshoes_thumb.jpg",130,130,15);thumbnails[5094292]=new thumbnail(5094292,"73841","Cicus of Doom (third CD)","3_Circus-of-Doom_thumb.jpg",130,130,15);thumbnails[5094297]=new thumbnail(5094297,"73841","Sting in the Tale (4th CD)","4_A_Sting_In_The_Tail1_thumb.jpg",130,130,15);thumbnails[5094298]=new thumbnail(5094298,"73841","Hive of Horror (5th CD)","5_Hive_of_Horror_thumb.jpg",130,130,15);thumbnails[5094303]=new thumbnail(5094303,"73841","Latest Adam F CD cover","Adam-F_thumb.jpg",130,130,15);thumbnails[5094305]=new thumbnail(5094305,"73839","Alpha fire","Alpha-fire_thumb.jpg",130,170,15);thumbnails[5094309]=new thumbnail(5094309,"73839","Stronty shoot-out","Stronty-shootout_thumb.jpg",130,170,15);thumbnails[5094310]=new thumbnail(5094310,"73839","Spidey","spidey-lighter-bg_thumb.jpg",130,184,15);thumbnails[5094311]=new thumbnail(5094311,"73841","The Trudy's latest album Cover","the-Trudy-cover_thumb.jpg",130,129,15);thumbnails[5094312]=new thumbnail(5094312,"73841","Comission for Johnathan Ross","rossy_thumb.jpg",130,130,15);thumbnails[5094313]=new thumbnail(5094313,"214481","Torchwood: Stakes on a Plane","Stakes-on-a-plane-torchwoo_thumb.jpg",130,92,15);thumbnails[5094316]=new thumbnail(5094316,"73842","New Dalek design","NEW-DALEK-design_thumb.jpg",130,143,15);thumbnails[5094320]=new thumbnail(5094320,"73842","New Dalek design scale","NEW-DALEK-scale_thumb.jpg",130,79,15);thumbnails[5118716]=new thumbnail(5118716,"73838","The Hulk","hulk_thumb.jpg",130,122,15);thumbnails[5118717]=new thumbnail(5118717,"73838","Hulk rough colour","hulk-rough-colour_thumb.jpg",130,78,15);thumbnails[5123344]=new thumbnail(5123344,"73838","The Punisher","punisher_thumb.jpg",130,194,15);thumbnails[5165751]=new thumbnail(5165751,"73838","Iron fist redesign- Rough colour","Iron-Fist_thumb.jpg",130,178,15);thumbnails[5166390]=new thumbnail(5166390,"73838","Another Iron Fist composition","Iron-Fist-2_thumb.jpg",130,133,15);thumbnails[5356044]=new thumbnail(5356044,"73838","Luke Cage (Powerman) redesign","luke-cage_thumb.jpg",130,122,15);thumbnails[5356062]=new thumbnail(5356062,"73838","Wolverine in the shadows: SNIKT","wolverine_thumb.jpg",130,197,15);thumbnails[5356073]=new thumbnail(5356073,"73839","THOR NY","Thor_thumb.jpg",130,197,15);thumbnails[5356076]=new thumbnail(5356076,"73839","Ock and Spidey","spidey-page_thumb.jpg",130,201,15);thumbnails[3533984]=new thumbnail(3533984,"73837","Badlad","BADLADs-Charger_thumb.jpg",130,85,15);thumbnails[3534035]=new thumbnail(3534035,"73837","alpha dredd","alpha-dredd_thumb.jpg",130,169,15);thumbnails[3534037]=new thumbnail(3534037,"73837","mean angel","mean-machine_thumb.jpg",130,171,15);thumbnails[3775863]=new thumbnail(3775863,"73837","Hammer time","wolf_thumb.jpg",130,190,15);thumbnails[3775877]=new thumbnail(3775877,"73837","Dredd head tread","tread_thumb.jpg",130,194,15);thumbnails[3775894]=new thumbnail(3775894,"73837","from the shadows","shadow_thumb.jpg",130,191,15);thumbnails[3775921]=new thumbnail(3775921,"73837","Judge Death","judge-death_thumb.jpg",130,186,15);thumbnails[3927188]=new thumbnail(3927188,"73837","Jack Staff","jack_staff_thumb.jpg",130,201,15);thumbnails[5356067]=new thumbnail(5356067,"73837","SKaro's Finest","IDW-WHO-COVER_thumb.jpg",130,203,15);var galleries=new Object();galleries[214481]=new gallery(214481,"5094313,4365468,4365467,4365465,4365464,4365405,3927201,3927198,3775941,3775884","Books and Graphic Novels","gallery",[3534002,3775884,3775941,3927198,3927201,4365405,4365464,4365465,4365467,4365468,5094313]);galleries[214482]=new gallery(214482,"3533992","CGI","gallery",[3533985,3533992,3533993]);galleries[73839]=new gallery(73839,"3534033","Comics","gallery",[3534003,3534005,3534033,3534034,3775881,3775890,3775909,3775913,3775916,3775936,3775950,4365469,4365470,5094305,5094309,5094310,5356073,5356076]);galleries[73842]=new gallery(73842,"3533994","Concept Art","gallery",[3533994,3533999,3775925,3927196,5094316,5094320]);galleries[73840]=new gallery(73840,"3775932,3534006,3533996,3533988","Doctor Who ","gallery",[3533988,3533996,3534006,3775932]);galleries[73841]=new gallery(73841,"5094312,5094311,5094303,5094298,5094297,5094292,5094289,5094277,3927200,3775928","Misc Commissions","gallery",[983420,3533989,3775928,3927200,5094277,5094289,5094292,5094297,5094298,5094303,5094311,5094312]);galleries[73838]=new gallery(73838,"5356062,5356044,5166390,5165751,5123344,5118717,5118716,3927193,3775945,3534013","Sketch Book","gallery",[3534007,3534013,3775945,3927193,5118716,5118717,5123344,5165751,5166390,5356044,5356062]);galleries[73837]=new gallery(73837,"5356067,3927188,3775921,3775894,3775877,3775863,3534037,3534035,3533984","Posters","gallery",[3533984,3534035,3534037,3775863,3775877,3775894,3775921,3927188,5356067]);var imageSets=new Object();imageSets[1]="5356076,5356073,5356067,5356062,5356044,5166390,5165751,5123344,5118717,5118716,5094320,5094316,5094313,5094312,5094311,5094310,5094309,5094305,5094303,5094298,5094297,5094292,5094289,5094277,4365470,4365469,4365468,4365467,4365465,4365464,4365405,3927201,3927200,3927198,3927196,3927193,3927188,3775950,3775945,3775941,3775936,3775932,3775928,3775925,3775921,3775916,3775913,3775909,3775894,3775890";imageSets[2]="3534033,3533994,3533992";imageSets[3]="5356076,5356073,5356067,5356062,5356044,5166390,5165751,5123344,5118717,5118716,5094320,5094316,5094313,5094312,5094311,5094310,5094309,5094305,5094303,5094298,5094297,5094292,5094289,5094277,4365470,4365469,4365468,4365467,4365465,4365464,4365405,3927201,3927200,3927198,3927196,3927193,3927188,3775950,3775945,3775941,3775936,3775932,3775928,3775925,3775921,3775916,3775913,3775909,3775894,3775890";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 34:b="http://www9.clikpic.com/Willsher/images";break}switch(a){case 1:b="http://www1.clikpic.com/Willsher/images";break}switch(a){case 2:b="http://admin.clikpic.com/Willsher/images";break}switch(a){case 4:b="http://www.clikchurch.com/Willsher/images";break}switch(a){case 5:b="http://www2.clikpic.com/Willsher/images";break}switch(a){case 15:b="http://www3.clikpic.com/Willsher/images";break}switch(a){case 21:b="http://www6.clikpic.com/Willsher/images";break}switch(a){case 18:b="http://www4.clikpic.com/Willsher/images";break}switch(a){case 19:b="http://www5.clikpic.com/Willsher/images";break}switch(a){case 22:b="http://tpc5/clikpic/Willsher/images";break}switch(a){case 23:b="http://tpc10/clikpic/Willsher/images";break}switch(a){case 24:b="http://tpc15/clikpic/Willsher/images";break}switch(a){case 25:b="http://tpc16/clikpic/Willsher/images";break}switch(a){case 31:b="http://www7.clikpic.com/Willsher/images";break}switch(a){case 32:b="http://admin2.clikpic.com/Willsher/images";break}switch(a){case 33:b="http://www8.clikpic.com/Willsher/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="Ben Willsher Graphics and Imaging: "+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>Title </strong>'+photos[b].location+"</p>"}if(photos[b].photographer!=""){a=a+'<p class="imageinfo" id="imagePhotographer"><strong>Artist </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+'")'})}}};