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[4363980]=new thumbnail(4363980,"256468","Alba ad Astra booklet","aaa_book_cover_thumb.jpg",130,186,18);thumbnails[4497183]=new thumbnail(4497183,"256468","Plate No 1","plate_1a_thumb.jpg",130,93,18);thumbnails[4497186]=new thumbnail(4497186,"256468","Plate No 2","plate_2_thumb.jpg",130,93,18);thumbnails[4497189]=new thumbnail(4497189,"256468","Plate No 3","plate_3_thumb.jpg",130,93,18);thumbnails[4497308]=new thumbnail(4497308,"256468","Plate No 4","plate_4_thumb.jpg",130,182,18);thumbnails[4497315]=new thumbnail(4497315,"256468","Plate No 5","plate_5_thumb.jpg",130,87,18);thumbnails[4497318]=new thumbnail(4497318,"256468","Plate No 6","plate_6_thumb.jpg",130,87,18);thumbnails[4497321]=new thumbnail(4497321,"256468","Plate No 7","plate_7_thumb.jpg",130,195,18);thumbnails[4497324]=new thumbnail(4497324,"256468","Plate No 8","plate_8_thumb.jpg",130,182,18);thumbnails[4497335]=new thumbnail(4497335,"256468","Plate No 9","plate_9_thumb.jpg",130,181,18);thumbnails[4497327]=new thumbnail(4497327,"256468","Plate No 10","plate_10_thumb.jpg",130,195,18);thumbnails[4497345]=new thumbnail(4497345,"256468","Plate No 11","plate_11_thumb.jpg",130,195,18);thumbnails[4497366]=new thumbnail(4497366,"256468","Plate No 12","plate_12_thumb.jpg",130,183,18);thumbnails[4497377]=new thumbnail(4497377,"256468","Plate No 13","plate_13_thumb.jpg",130,93,18);thumbnails[4497383]=new thumbnail(4497383,"256468","Plate No 14","plate_14_thumb.jpg",130,93,18);thumbnails[2557449]=new thumbnail(2557449,"163354","Non-stop ponics [digital print 2008, edition of 1]","nonstop_ponics_2_thumb.jpg",130,182,18);thumbnails[2557457]=new thumbnail(2557457,"163354","Siloën’s arm <br>\r\n[digital print 2008, edition of 1]<br>\r\n","greenchildskin4_thumb.jpg",130,182,18);thumbnails[2557459]=new thumbnail(2557459,"163354","A terrible, indescribable thing <br>\r\n[digital print 2008, edition of 1]<br>\r\n","eyeballthing3_thumb.jpg",130,173,18);thumbnails[2557452]=new thumbnail(2557452,"163354","Abandoned Manhattan  [digital print 2008, edition of 1]","abandoned-manhattan_thumb.jpg",130,182,18);thumbnails[2557447]=new thumbnail(2557447,"163354","Bhelsheved paving <br>\r\n[digital print 2008, edition of 1]","Bhelsheved_paving-_thumb.jpg",130,182,18);thumbnails[2557548]=new thumbnail(2557548,"163354","Helward’s world [hand-knitted wool, 2008]<br>\r\n","inverted_world_thumb.jpg",130,173,18);thumbnails[2557517]=new thumbnail(2557517,"163354","Paper skin <br>\r\n[solvent transfer monoprint 2008]<br>\r\n","paperskin_scan_thumb.jpg",130,96,18);thumbnails[2557521]=new thumbnail(2557521,"163354","Martian lichen [digital print 2008, edition of 1]","martian_lichen4_thumb.jpg",130,93,18);thumbnails[2557526]=new thumbnail(2557526,"163354","Moon dust <br>\r\n[digital print 2008, edition of 1]<br>\r\n","moondust2_thumb.jpg",130,93,18);thumbnails[2557529]=new thumbnail(2557529,"163354","Mimoid hyperproduction [digital print 2008, edition of 1]","solaris6_thumb.jpg",130,93,18);thumbnails[2557532]=new thumbnail(2557532,"163354","Metal salt marshes  [digital print 2008, edition of 1]","metal_salt_marsh_2_thumb.jpg",130,93,18);thumbnails[2557442]=new thumbnail(2557442,"163354","The blue world from space  [cyanotype and watercolour 2008]","blue_world_scan2_thumb.jpg",130,130,18);thumbnails[1573684]=new thumbnail(1573684,"58574","Nuno scarves in autumn colours","finished_thumb.jpg",130,52,18);thumbnails[1573688]=new thumbnail(1573688,"58574","Detail of sunset scarf","detail_orange_thumb.jpg",130,173,18);thumbnails[1573695]=new thumbnail(1573695,"58574","Detail of forest floor scarf","detail_dark_green_thumb.jpg",130,92,18);thumbnails[1455255]=new thumbnail(1455255,"58574","Cream nuno felt scarf","creamnuno_thumb.jpg",130,151,18);thumbnails[623461]=new thumbnail(623461,"58574","Orkney bowl","cream_bowl_thumb.jpg",130,88,18);thumbnails[623462]=new thumbnail(623462,"58574","Cream pot","cream_pot_thumb.jpg",130,91,18);thumbnails[1455249]=new thumbnail(1455249,"58574","Marine blue nuno felt scarf","bluenuno_thumb.jpg",130,139,18);thumbnails[623464]=new thumbnail(623464,"58574","Marine bowl","marine_blues_bowl_thumb.jpg",130,78,18);thumbnails[623466]=new thumbnail(623466,"58574","Marine Vase","marine_blues_pot_thumb.jpg",130,149,18);thumbnails[1455258]=new thumbnail(1455258,"58574","nuno felt scarf in pinks and purples","pink-nuno_thumb.jpg",130,136,18);thumbnails[1455340]=new thumbnail(1455340,"58574","Pink mobius basket","pinkmobius_thumb.jpg",130,110,18);thumbnails[1455342]=new thumbnail(1455342,"58574","Cell Brooch","cellbrooch_thumb.jpg",130,130,18);thumbnails[756355]=new thumbnail(756355,"58455","Tendril","tendril_thumb.jpg",130,125,18);thumbnails[756362]=new thumbnail(756362,"58455","Stone Elephant","stoneelephant_thumb.jpg",130,93,18);thumbnails[756363]=new thumbnail(756363,"58455","Skara Brae Wall","skarawall_thumb.jpg",130,88,18);thumbnails[756366]=new thumbnail(756366,"58455","Toned Cyanotype Scarf","LaceScarf_thumb.jpg",130,90,18);thumbnails[756368]=new thumbnail(756368,"58455","Collection of cyanotype scarves","CyanoScarves_thumb.jpg",130,87,18);thumbnails[756370]=new thumbnail(756370,"58455","Bacchus","bacchus_thumb.jpg",130,198,18);thumbnails[756346]=new thumbnail(756346,"58462","Bark Coast","BarkCoast_thumb.jpg",130,95,18);thumbnails[756343]=new thumbnail(756343,"58462","Dark Land","DarkLand_thumb.jpg",130,95,18);thumbnails[756337]=new thumbnail(756337,"58462","Pastel Kaleidoscope I","PastelKaleidoscope_thumb.jpg",130,94,18);thumbnails[756342]=new thumbnail(756342,"58462","Benaiki Gallery Athens","NeoBenaiki_thumb.jpg",130,103,18);thumbnails[756338]=new thumbnail(756338,"58462","Olives at Sunset","OlivesAtSunset_thumb.jpg",130,105,18);thumbnails[757607]=new thumbnail(757607,"58462","Blue Door, Athens","BlueDoor_thumb.jpg",130,98,18);thumbnails[756372]=new thumbnail(756372,"58454","Young Fern","YoungFern_thumb.jpg",130,129,18);thumbnails[756376]=new thumbnail(756376,"58454","Pollenation","pollenation1_thumb.jpg",130,130,18);thumbnails[756377]=new thumbnail(756377,"58454","Narcissus","narcisuss_thumb.jpg",130,130,18);thumbnails[756379]=new thumbnail(756379,"58454","Drip","drip_thumb.jpg",130,86,18);thumbnails[756380]=new thumbnail(756380,"58454","Crocus","crocus_thumb.jpg",130,86,18);thumbnails[756387]=new thumbnail(756387,"58454","Californian Poppy","CalifornianPoppy_thumb.jpg",130,86,18);thumbnails[1574320]=new thumbnail(1574320,"58454","Maple tree in Branklyn Garden Perth","maple_thumb.jpg",130,87,18);thumbnails[1574321]=new thumbnail(1574321,"58454","Puffball fungus in the Hermitage of Dunkeld","pufballs_thumb.jpg",130,87,18);thumbnails[1574323]=new thumbnail(1574323,"58454","Beech tree in the Hermitage of Dunkeld","beech_thumb.jpg",130,87,18);thumbnails[1227364]=new thumbnail(1227364,"88531","Harry Turtledove <br>\r\n","turtledove_thumb.jpg",130,130,18);thumbnails[1227366]=new thumbnail(1227366,"88531","Elizabeth Moon","moon_thumb.jpg",130,142,18);thumbnails[1227369]=new thumbnail(1227369,"88531","Deborah J Miller","miller_thumb.jpg",130,162,18);thumbnails[1227376]=new thumbnail(1227376,"88531","Ken Macleod","Macleod_thumb.jpg",130,205,18);thumbnails[1227378]=new thumbnail(1227378,"88531","Ron Butlin","butlin_thumb.jpg",130,167,18);thumbnails[1227381]=new thumbnail(1227381,"88531","Iain M Banks","banks_thumb1.jpg",130,134,18);var galleries=new Object();galleries[256468]=new gallery(256468,"4497308,4363980","Alba ad Astra","gallery",[4363980,4497183,4497186,4497189,4497308,4497315,4497318,4497321,4497324,4497335,4497327,4497345,4497366,4497377,4497383]);galleries[163354]=new gallery(163354,"2557449","Alien Surfaces","gallery",[2557449,2557457,2557459,2557452,2557447,2557548,2557517,2557521,2557526,2557529,2557532,2557442]);galleries[58574]=new gallery(58574,"1455249,623466","Felt work","gallery",[1573684,1573688,1573695,1455255,623461,623462,1455249,623464,623466,1455258,1455340,1455342]);galleries[58455]=new gallery(58455,"756370","Cyanotypes","gallery",[756355,756362,756363,756366,756368,756370]);galleries[58462]=new gallery(58462,"756342","Digitals","gallery",[756346,756343,756337,756342,756338,757607]);galleries[58454]=new gallery(58454,"756372","Botanicals","gallery",[756372,756376,756377,756379,756380,756387,1574320,1574321,1574323]);galleries[88531]=new gallery(88531,"1227378,1227366","Bestiary of Authors - Solvent Transfers","gallery",[1227364,1227366,1227369,1227376,1227378,1227381]);var imageSets=new Object();imageSets[1]="4497327,2557449,2557442,1574321,1573688,1455340,757607,623461";imageSets[2]="4497308,4363980,2557449,1455249,1227378,1227366,756372,756370,756342,623466";imageSets[3]="2557532,2557529,2557521,2557452,2557449,2557442,1455340,623464";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/madeleineshepherd/images";break}switch(a){case 1:b="http://www1.clikpic.com/madeleineshepherd/images";break}switch(a){case 2:b="http://admin.clikpic.com/madeleineshepherd/images";break}switch(a){case 4:b="http://www.clikchurch.com/madeleineshepherd/images";break}switch(a){case 5:b="http://www2.clikpic.com/madeleineshepherd/images";break}switch(a){case 15:b="http://www3.clikpic.com/madeleineshepherd/images";break}switch(a){case 21:b="http://www6.clikpic.com/madeleineshepherd/images";break}switch(a){case 18:b="http://www4.clikpic.com/madeleineshepherd/images";break}switch(a){case 19:b="http://www5.clikpic.com/madeleineshepherd/images";break}switch(a){case 22:b="http://tpc5/clikpic/madeleineshepherd/images";break}switch(a){case 23:b="http://tpc10/clikpic/madeleineshepherd/images";break}switch(a){case 24:b="http://tpc15/clikpic/madeleineshepherd/images";break}switch(a){case 25:b="http://tpc16/clikpic/madeleineshepherd/images";break}switch(a){case 31:b="http://www7.clikpic.com/madeleineshepherd/images";break}switch(a){case 32:b="http://admin2.clikpic.com/madeleineshepherd/images";break}switch(a){case 33:b="http://www8.clikpic.com/madeleineshepherd/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="Madeleine Shepherd MSc - Photography & Textiles: "+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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';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">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="MADELEINESHEPHERD">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";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+'")'})}}};