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[3395881]=new thumbnail(3395881,"","","Horseshoe_thumb.jpg",130,98,1);thumbnails[5261171]=new thumbnail(5261171,"296177","Material Cultures Ladderax Shelving System featured in Miro Hanatsubaki, January 2010, Japan","Press_11_thumb.jpg",130,184,1);thumbnails[5261139]=new thumbnail(5261139,"296177","","Press_2_thumb.jpg",130,184,1);thumbnails[3999661]=new thumbnail(3999661,"43693","Ercol Butler Coffee Table, £150, with Ercol Windsor Bow-top Armchair, with original upholstery, £120","Ercol_Butler_Coffee_Table_With_Windsor_Bow_Top_Armchair_449A_thumb.jpg",130,100,1);thumbnails[3999669]=new thumbnail(3999669,"43693","Ercol Quaker Windsor Armchairs, £175 (pair)","Ercol_Quacker_Windsor_365A_Armchairs_thumb.jpg",130,94,1);thumbnails[3999676]=new thumbnail(3999676,"43693","Ercol Quaker Chairs, set of four, £150","Ercol_Windsor_Chair_thumb.jpg",130,173,1);thumbnails[3999678]=new thumbnail(3999678,"43693","Bruno Pollak, Cox Manufacturer, tubular industrial design stacking chairs, set of six restored with brand new canvas, £360. ","Cox_Stacking_Chairs_thumb.jpg",130,94,1);thumbnails[3999714]=new thumbnail(3999714,"43693","Bruno Pollak, Cox Manufacturer, tubular industrial design stacking chairs, set of six restored with brand new canvas, £360. ","Cox_Stack_thumb.jpg",130,173,1);thumbnails[3395838]=new thumbnail(3395838,"43693","Ercol Windsor Lattice Chairs, £150 (pair)","Candlestick_thumb.jpg",130,98,1);thumbnails[3141290]=new thumbnail(3141290,"43693","Superb Quality Leather Chair, £95 each (six available, stackable) ","Leather_Chair_thumb.jpg",130,173,1);thumbnails[2505964]=new thumbnail(2505964,"43693","Ercol Rocking Chair, £180","Ercol_Rocking_Chair_thumb.jpg",130,173,1);thumbnails[5557379]=new thumbnail(5557379,"43693","Ercol Children's Chair, with double bar across and yellow dot at the back, H 58cm W 36.5cm, D 37cm, £65","Ercol_Childres_Chair_Double_Bar_thumb.jpg",130,173,1);thumbnails[5557386]=new thumbnail(5557386,"43693","Ercol Children's Chair, with single bar across, H 58.5cm W 35.5cm, D 42cm, £65","Ercol_Childres_Chair_Single_Bar_thumb.jpg",130,173,1);thumbnails[4009070]=new thumbnail(4009070,"43693","Ercol dressing or desk chair, £85, SOLD","Ercol_Dressing_Desk_Chair_thumb.jpg",130,173,1);thumbnails[2480959]=new thumbnail(2480959,"43693","Ercol Windsor Lattice Chairs, £160 (pair), SOLD","Ercol_Criss_Cross_Chairs_thumb.jpg",130,99,1);thumbnails[3141396]=new thumbnail(3141396,"43693","Danish Desk Chair, Manufacturer: N. Eilersen, est. 1895, SOLD","Danish_Chair_thumb.jpg",130,173,1);thumbnails[3395825]=new thumbnail(3395825,"43693","Ercol Love seat, £320, sold","Loveseat_thumb.jpg",130,98,1);thumbnails[3477766]=new thumbnail(3477766,"43695",'Ercol "utility" dining table, £240',"Ercol_Round_Dining_Table_thumb.jpg",130,173,1);thumbnails[567242]=new thumbnail(567242,"43695","Ercol Butler Coffee Table, £150","ercol_butler_coffee_table_thumb.jpg",130,173,1);thumbnails[567244]=new thumbnail(567244,"43695","Ercol Coffee Table","ercol_coffee_table_thumb.jpg",130,173,1);thumbnails[567251]=new thumbnail(567251,"43695","Ercol round drop-leaf coffee table","ercol_round_dropleaf_coffee_table_thumb.jpg",130,173,1);thumbnails[567248]=new thumbnail(567248,"43695","Ercol Nest of Tables<br>\r\nSOLD","ercol_nest_thumb.jpg",130,173,1);thumbnails[4195936]=new thumbnail(4195936,"43695","Ercol Long Occasional Table, SOLD","Extended_Ercol_Coffee_Table_thumb.jpg",130,89,1);thumbnails[2505967]=new thumbnail(2505967,"43695","James Leonard School Desk and Chair, SOLD","James_Leonard_School_Desk_and_Chair_thumb.jpg",130,98,1);thumbnails[3573981]=new thumbnail(3573981,"43695","Ercol Dining Table, Drop-leaf, £220, SOLD","Ercol_Table_Drop_Leaf1_thumb.jpg",130,173,1);thumbnails[3395854]=new thumbnail(3395854,"43695","Zinc-coated steel top table, H 78cm W 97cm  D 43cm, £230, sold, more available on request","Zinc_coated_steel_top_table_thumb.jpg",130,98,1);thumbnails[3939022]=new thumbnail(3939022,"43671","Wall-hanging Cupboards. They were bullet boxes originally, H 42.5cm  W 21.5cm D 20cm, £45 each (2 available)","Bullet_Box_thumb.jpg",130,85,1);thumbnails[5110376]=new thumbnail(5110376,"43671","Ladderax Slim Bookshelves, also available in black, H 201cm W 78.2cm D20.2cm, SOLD ","Ladderax_White_Narrow_1_thumb.jpg",130,185,1);thumbnails[4699702]=new thumbnail(4699702,"43671","Ladderax lipped slim bookshelves, ladders available in black and white, H 163cm W 94cm D 20.5cm, £245 ","Ladderax_Short_thumb.JPG",130,109,1);thumbnails[3698387]=new thumbnail(3698387,"43671","Ladderax Desk, available with Black or white Ladders, H 162.6cm W 91.5cm D 35.5cm, £180","Ladderax_desk_unit1_thumb.jpg",130,173,1);thumbnails[4601120]=new thumbnail(4601120,"43671","Ladderax with the smallest width shelving available in the Ladderax range, MORE WILL BE AVAILABLE SOON","Ladderax_Narrow_Shelves_1_thumb.jpg",130,215,1);thumbnails[4009059]=new thumbnail(4009059,"43671","Ladderax Slim Bookshelves, also available in black, H 201cm W 93.5cm D 20.2cm, SOLD","Ladderax_Slim_Bookshelves_White_thumb.jpg",130,211,1);thumbnails[3809732]=new thumbnail(3809732,"43671","Ladderax Unit Shelving, Available in Black or White, H 201cm W 93.3cm D 35.5cm, £240","Ladderax_Shelves_Black_thumb.jpg",130,173,1);thumbnails[3698382]=new thumbnail(3698382,"43671","Ladderax Unit Furniture System, available with Black or White Ladders, H 201cm W 139.2cm D 35.5cm, £350","Ladderax_narrow_shelves_thumb.jpg",130,164,1);thumbnails[5119798]=new thumbnail(5119798,"43671","Ladderax Shelving with Wooden Ladders, SOLD","Ladderax_Wooden_Ladders_thumb.jpg",130,185,1);thumbnails[567257]=new thumbnail(567257,"43671","Ladderax Unit Furniture System, White Ladders, H 201cm W 154.5cm D 40.5cm, SOLD","Ladderax_White1_thumb.jpg",130,173,1);thumbnails[567260]=new thumbnail(567260,"43671","Ladderax Unit Furniture System, Black Ladders, H 201cm w 154.5cm D 40.5cm, SOLD<br>\r\n","Ladderax_Black2_thumb.jpg",130,173,1);thumbnails[567262]=new thumbnail(567262,"43671","Ladderax Unit Furniture System, Black Ladders, H 201cm W 154.5cm D 35.5cm, SOLD","Ladderax_Black3_thumb.jpg",130,173,1);thumbnails[567259]=new thumbnail(567259,"43671","Ladderax Unit Furniture System, Black Ladders, H 201cm W 154.5cm D 35.5cm, SOLD<br>\r\n","Ladderax_Black1_thumb.jpg",130,173,1);thumbnails[4009060]=new thumbnail(4009060,"43671","Smaller Ladderax Shelving System, also available in black, H 162.5cm W 78.5cm D35.5cm, SOLD","Ladderax_Smaller_Shelving_thumb.jpg",130,211,1);thumbnails[2505962]=new thumbnail(2505962,"43671","Ladderax Unit Furniture System, White Ladders, H 201cm W 78cm D 35.5cm SOLD","Ladderax_Single_Bay_White_thumb.jpg",130,173,1);thumbnails[4397503]=new thumbnail(4397503,"43671","Ladderax Slim Bookshelves (Narrow Bookshelf Ladders), with widest shelves available, H<br>\r\n201cm, W 109 cm, D 20cm, £320, SOLD","Ladderax_Shelving_Wider_Shelves_thumb.jpg",130,203,1);thumbnails[4415601]=new thumbnail(4415601,"258670","Artemide Lights, Tolomeo Tavolo Mini, by Michele de Lucchi and Giancarlo Fassina, £125 each","Artemide_Lights_1_thumb.jpg",130,183,1);thumbnails[3809721]=new thumbnail(3809721,"232047","A Victorian mirror solid mahogany, suitable for home interiors or shop display, £250","Victorian_Mirror_thumb.jpg",130,173,1);thumbnails[3478423]=new thumbnail(3478423,"43800","Shop display figure, £160","Figure_11_thumb.jpg",130,173,1);thumbnails[4513562]=new thumbnail(4513562,"43800","Welsh Blanket (Wool), £65 ","Welsh_Blanket_thumb.jpg",130,144,1);thumbnails[567901]=new thumbnail(567901,"43800","Picquot Ware Tea/Coffee Set","accessories_picquot_set_thumb.jpg",130,98,1);thumbnails[567903]=new thumbnail(567903,"43800","Poole Pottery Coffee Set, £55","accessories_poole_coffee_set_thumb.jpg",130,98,1);thumbnails[567908]=new thumbnail(567908,"43800","Procter : Rihl Space Lily Bowl designed 1997","space_lily_bowl_thumb.jpg",130,98,1);thumbnails[2480954]=new thumbnail(2480954,"43800","Centurion ply tray table, £65 ","Centurion_Tray_Table_thumb.jpg",130,98,1);thumbnails[2480950]=new thumbnail(2480950,"43697","Bespoke Ladderax arrangement in customer's home ","Customer_1_thumb.jpg",130,173,1);thumbnails[2480951]=new thumbnail(2480951,"43697","Bespoke Ladderax arrangement, Barbican, London","Customer_2_thumb.jpg",130,173,1);thumbnails[3141286]=new thumbnail(3141286,"43697","South West London","Customer_31_thumb.jpg",130,195,1);thumbnails[5261182]=new thumbnail(5261182,"43697","Paris","Customer_France_thumb.jpg",130,107,1);thumbnails[3268187]=new thumbnail(3268187,"43697","Architectural practice, Essex","Customer_5_thumb.jpg",130,98,1);thumbnails[3268624]=new thumbnail(3268624,"43697","Architectural practice, Essex","Customer_5a_thumb.jpg",130,114,1);thumbnails[3993983]=new thumbnail(3993983,"43697","Stoke Newington, N16","Customer_6_thumb.jpg",130,173,1);thumbnails[4397469]=new thumbnail(4397469,"43697","East London","Ladderax_Chest_Sold_thumb.jpg",130,102,1);thumbnails[2756755]=new thumbnail(2756755,"43697","Ladder Restoration ","Ladder_Restoration_thumb.jpg",130,173,1);var galleries=new Object();galleries[296177]=new gallery(296177,"5261139","Japan","section354053",[5261171,5261139]);galleries[43693]=new gallery(43693,"5557386,5557379,4009070,3999678,3999661,3395838,3141290","Seating","gallery",[3999661,3999669,3999676,3999678,3999714,3395838,3141290,2505964,5557379,5557386,4009070,2480959,3141396,3395825]);galleries[43695]=new gallery(43695,"4195936,2505967","Tables","gallery",[3477766,567242,567244,567251,567248,4195936,2505967,3573981,3395854]);galleries[43671]=new gallery(43671,"5110376,4699702,4601120,4397503,3698382,567257","Shelving & Storage","gallery",[3939022,5110376,4699702,3698387,4601120,4009059,3809732,3698382,5119798,567257,567260,567262,567259,4009060,2505962,4397503]);galleries[258670]=new gallery(258670,"4415601","Lighting","gallery",[4415601]);galleries[232047]=new gallery(232047,"3809721","Mirrors","gallery",[3809721]);galleries[43800]=new gallery(43800,"4513562,3478423,567908","Accessories","gallery",[3478423,4513562,567901,567903,567908,2480954]);galleries[43697]=new gallery(43697,"5261182,2480950","Bespoke","gallery",[2480950,2480951,3141286,5261182,3268187,3268624,3993983,4397469,2756755]);var imageSets=new Object();imageSets[1]="5557386,5557379,5110376,4699702,4601120,4415601,4397503,4397469,4195936,4009070,4009059,3999714,3999678,3999661,3809732,3809721,3698382,3478423,3395881,3395838";imageSets[2]="5557386,5557379,5261182,5261139,5110376,4699702,4601120,4513562,4415601,4397503,4195936,4009070,3999678,3999661,3809721,3698382,3478423,3395838,3141290,2505967,2480950,567908,567257";imageSets[3]="5557386,5557379,5261182,5261171,5261139,5119798,5110376,4699702,4601120,4513562,4415601,4397503,4397469,4195936,4009070,4009060,4009059,3999714,3999678,3999676,3999669,3999661,3993983,3939022,3809732,3809721,3698387,3698382,3573981,3478423,3477766,3395881,3395854,3395838,3395825,3268624,3268187,3141396,3141290,3141286,2756755,2505967,2505964,2505962,2480959,2480954,2480951,2480950,567908,567903";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/materialcultures/images";break}switch(a){case 1:b="http://www1.clikpic.com/materialcultures/images";break}switch(a){case 2:b="http://admin.clikpic.com/materialcultures/images";break}switch(a){case 24:b="http://tpc15/clikpic/materialcultures/images";break}switch(a){case 4:b="http://www.clikchurch.com/materialcultures/images";break}switch(a){case 5:b="http://www2.clikpic.com/materialcultures/images";break}switch(a){case 22:b="http://tpc5/clikpic/materialcultures/images";break}switch(a){case 23:b="http://tpc10/clikpic/materialcultures/images";break}switch(a){case 25:b="http://tpc16/clikpic/materialcultures/images";break}switch(a){case 15:b="http://www3.clikpic.com/materialcultures/images";break}switch(a){case 18:b="http://www4.clikpic.com/materialcultures/images";break}switch(a){case 19:b="http://www5.clikpic.com/materialcultures/images";break}switch(a){case 31:b="http://www7.clikpic.com/materialcultures/images";break}switch(a){case 32:b="http://admin2.clikpic.com/materialcultures/images";break}switch(a){case 33:b="http://www8.clikpic.com/materialcultures/images";break}switch(a){case 34:b="http://www9.clikpic.com/materialcultures/images";break}switch(a){case 35:b="http://admin3.clikpic.com/materialcultures/images";break}switch(a){case 37:b="http://admin4.clikpic.com/materialcultures/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="Material Cultures: "+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+'")'})}}};