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[60550]=new thumbnail(60550,"","Paris","paris_thumb.jpg",130,100,1);thumbnails[60556]=new thumbnail(60556,"","Berlin Zoo","069600011_thumb.jpg",130,89,1);thumbnails[1107197]=new thumbnail(1107197,"","Commisioned Portrait","CRW_2086_thumb.jpg",130,107,1);thumbnails[1107492]=new thumbnail(1107492,"","Fund Raiser for the NHS","IMG_9881_thumb.jpg",130,194,1);thumbnails[3130466]=new thumbnail(3130466,"","","IMG_7855_thumb.jpg",129,103,1);thumbnails[3396160]=new thumbnail(3396160,"","","IMG_3726_thumb.jpg",130,87,1);thumbnails[3396185]=new thumbnail(3396185,"","","IMG_1273_thumb.jpg",130,82,1);thumbnails[3397268]=new thumbnail(3397268,"","","IMG_1106 copy 21_thumb.jpg",130,80,1);thumbnails[3397474]=new thumbnail(3397474,"","","sg2_thumb.jpg",130,87,1);thumbnails[3403813]=new thumbnail(3403813,"","","IMG_9881_1_thumb.jpg",130,185,1);thumbnails[3403991]=new thumbnail(3403991,"","","IMG_12733_thumb.jpg",130,89,1);thumbnails[3422314]=new thumbnail(3422314,"","","Photo 1355_thumb.jpg",130,199,1);thumbnails[3422711]=new thumbnail(3422711,"299660","","IMG_0015_thumb.jpg",130,200,1);thumbnails[3422715]=new thumbnail(3422715,"299660","","IMG_5542_thumb.jpg",130,158,1);thumbnails[3422718]=new thumbnail(3422718,"299661","Paul Ross for LBC Radio","IMG_9317_thumb.jpg",130,181,1);thumbnails[3423098]=new thumbnail(3423098,"","","chris_thumb.jpg",130,151,1);thumbnails[3455336]=new thumbnail(3455336,"299661","CD cover","_MG_1074 copy4_thumb.jpg",130,143,1);thumbnails[4118020]=new thumbnail(4118020,"209092","","_MG_7128_copy123_thumb.jpg",130,171,1);thumbnails[4118029]=new thumbnail(4118029,"299661","","_MG_58791_thumb.jpg",130,178,1);thumbnails[5324275]=new thumbnail(5324275,"209092","London United Busways","_MG_94552_thumb.jpg",130,130,1);thumbnails[106503]=new thumbnail(106503,"","Veterans and youth day for the Royal Star and Garter Home","IMG_3988 copy 1_thumb.jpg",130,94,1);thumbnails[3128409]=new thumbnail(3128409,"299661","BAA Engineering Challenge","IMG_6677 copy1_thumb.jpg",129,161,1);thumbnails[5324097]=new thumbnail(5324097,"209092","New Wimbledon Theatre","4135313747_5bb5c86b2c_thumb.jpg",130,165,1);thumbnails[1107161]=new thumbnail(1107161,"","Paul Ross for LBC Radio","IMG_9342_thumb.jpg",130,181,1);thumbnails[3396157]=new thumbnail(3396157,"","","IMG_4378_thumb.jpg",130,198,1);thumbnails[63794]=new thumbnail(63794,"299661","Evelyn Laye Actress","evelyn_thumb.jpg",130,185,1);thumbnails[3397292]=new thumbnail(3397292,"","","sg1_thumb.jpg",130,87,1);thumbnails[1107798]=new thumbnail(1107798,"299661","Rik Mayall for the Ambassadors Theatre Group","IMG_99892_thumb.jpg",130,195,1);thumbnails[3397272]=new thumbnail(3397272,"","","IMG_12731_thumb.jpg",130,88,1);thumbnails[3397334]=new thumbnail(3397334,"299661","Commissioned Portrait","662_thumb.jpg",130,187,1);thumbnails[33491]=new thumbnail(33491,"209092","Fund Raiser for the NHS","IMG_28461_thumb.jpg",130,191,1);thumbnails[149133]=new thumbnail(149133,"209092","Editorial Portrait","pic1_thumb.jpg",130,196,1);thumbnails[3403999]=new thumbnail(3403999,"","","99340019 copy_thumb.jpg",130,178,1);thumbnails[63137]=new thumbnail(63137,"209092","London United Busways","webb5_thumb.jpg",130,163,1);thumbnails[63144]=new thumbnail(63144,"299661","John Mills","webbb9_thumb.jpg",130,160,1);thumbnails[1483703]=new thumbnail(1483703,"299661","Zoe Waterman Director ","IMG_09101_thumb.jpg",130,178,1);thumbnails[3131339]=new thumbnail(3131339,"299660","Ken Livingstone for LBC Radio","_MG_3123 copy2_thumb.jpg",129,171,1);thumbnails[1107786]=new thumbnail(1107786,"299661","Baa Heathrow Airport","IMG_70501_thumb.jpg",130,194,1);thumbnails[63159]=new thumbnail(63159,"209092","BAA Heathrow Airport","IMG_69582_thumb.jpg",130,188,1);thumbnails[1735571]=new thumbnail(1735571,"209092","Groundwork Thames Valley","IMG_5628 copy4_thumb.jpg",129,196,1);thumbnails[1766174]=new thumbnail(1766174,"","Commisioned Portrait","IMG_4777 copy4_thumb.jpg",129,171,1);thumbnails[3130527]=new thumbnail(3130527,"209092","BAA Heathrow Airport","IMG_88482_thumb.jpg",129,194,1);thumbnails[3130568]=new thumbnail(3130568,"209092","Commissioned Portrait","IMG_48284_thumb.jpg",129,191,1);thumbnails[1455873]=new thumbnail(1455873,"209092","Anna Raeburn for LBC Radio","IMG_9256_thumb.jpg",130,158,1);thumbnails[3131344]=new thumbnail(3131344,"209092","New Wimbledon Theate","IMG_8451 copy_thumb.jpg",129,169,1);thumbnails[63139]=new thumbnail(63139,"209092","Editorial Portrait","webb10_thumb.jpg",130,177,1);thumbnails[3397270]=new thumbnail(3397270,"209092","BAA Heathrow Airport ","prev7 3_thumb.jpg",130,195,1);thumbnails[1736022]=new thumbnail(1736022,"299661","Actor Warwick Davis for the Ambassadors Theatre Group","IMG_9624 copy_thumb.jpg",129,200,1);thumbnails[3403867]=new thumbnail(3403867,"","","IMG_9231_thumb.jpg",130,178,1);thumbnails[60072]=new thumbnail(60072,"209092","Gordon Brown","vv_thumb.jpg",130,190,1);thumbnails[61651]=new thumbnail(61651,"209092","Indian Head Massage","ee1_thumb.jpg",130,195,1);thumbnails[1455875]=new thumbnail(1455875,"299661","Chris Tarrant","CRW_3712_thumb.jpg",130,195,1);thumbnails[1107567]=new thumbnail(1107567,"209092","NHS Recruitment ","IMG_02471_thumb.jpg",130,194,1);thumbnails[1736027]=new thumbnail(1736027,"209092","Family Day for BAA Heathrow Airport Ltd","IMG_4117 copy 1_thumb.jpg",129,196,1);thumbnails[3128350]=new thumbnail(3128350,"209092","Photo montage London United Busways","NIGHT copy_thumb.jpg",129,209,1);thumbnails[2576343]=new thumbnail(2576343,"209092","Jimmy Carr New Wimbledon Theatre","IMG_9850 copy_thumb.jpg",129,132,1);thumbnails[63140]=new thumbnail(63140,"209092","BAA Heathrow Airport","webbb_thumb.jpg",130,149,1);thumbnails[3128346]=new thumbnail(3128346,"209092","Commissioned portrait","IMG_4733 copy1_thumb.jpg",129,104,1);thumbnails[60603]=new thumbnail(60603,"209092","Guy's and St. Thomas' Hospital","prev113 copy_thumb.jpg",130,111,1);thumbnails[67742]=new thumbnail(67742,"209092","Commissioned Portrait","t4_thumb.jpg",130,108,1);thumbnails[106507]=new thumbnail(106507,"209092","Scottish Widows","IMG_7105 copy_thumb.jpg",130,102,1);thumbnails[146947]=new thumbnail(146947,"209092","The Queen for the NHS","IMG_2185 copy_thumb.jpg",130,138,1);thumbnails[1483695]=new thumbnail(1483695,"209092","Adrian Shooter Chairman of Chiltern Railways","IMG_01743_thumb.jpg",130,102,1);thumbnails[73921]=new thumbnail(73921,"209092","Commissioned Portrait","helenaaa1_thumb.jpg",130,87,1);thumbnails[146949]=new thumbnail(146949,"209092","Drag Artists","Untitled-1 copy 1_thumb.jpg",130,91,1);thumbnails[3403977]=new thumbnail(3403977,"209092","Abandoned baby","_MG_06654_thumb.jpg",130,88,1);thumbnails[189328]=new thumbnail(189328,"209092","Margareta Pracatan for the Ambassadors Theatre Group","mag401_thumb.jpg",130,86,1);thumbnails[1736019]=new thumbnail(1736019,"209092","Mike Brewer for Fortnum Cars","IMG_3370 copy 11_thumb.jpg",129,91,1);thumbnails[1734153]=new thumbnail(1734153,"209092","Commissioned Portrait","CRW_2085 copy3_thumb.jpg",129,87,1);thumbnails[3424208]=new thumbnail(3424208,"209092","Russ Kane and Chris Tarrant for The Royal Marsden","IMG_3673 copy1_thumb.jpg",130,88,1);thumbnails[1483684]=new thumbnail(1483684,"209092","Patrick Duffy for the Ambassadors Theatre Group","IMG_5754_thumb.jpg",130,90,1);thumbnails[61632]=new thumbnail(61632,"209092","Prince Edward for Surrey University","t1_thumb.jpg",130,87,1);thumbnails[3423055]=new thumbnail(3423055,"209092","Commissioned Portrait","im_thumb.jpg",130,87,1);thumbnails[63135]=new thumbnail(63135,"209092","BAA Heathrow Airport","webb3_thumb.jpg",130,93,1);thumbnails[63227]=new thumbnail(63227,"209092","Groundwork Thames Valley","web34_thumb.jpg",130,96,1);thumbnails[63136]=new thumbnail(63136,"209092","Diarmuid Gavin and Lawrence Lewelyn Bowen","webb4_thumb.jpg",130,88,1);thumbnails[3403911]=new thumbnail(3403911,"209092","John Barroman New Wimbledon Theatre","IMG_88974_thumb.jpg",130,87,1);thumbnails[1734943]=new thumbnail(1734943,"209092","Transdev","IMG_0364 copy 1_thumb.jpg",129,86,1);thumbnails[63790]=new thumbnail(63790,"209092","Mona Lisa","mona_thumb.jpg",130,86,1);thumbnails[63138]=new thumbnail(63138,"209092","School Prospectus","webb8_thumb.jpg",130,95,1);var galleries=new Object();galleries[209092]=new gallery(209092,"5324275,5324097,4118020,3424208,3423055,3403977,3403911,3397270,3131344,3130568","michael farenden","gallery",[4118020,5324275,5324097,33491,149133,63137,63159,1735571,3130527,3130568,1455873,3131344,63139,3397270,60072,61651,1107567,1736027,3128350,2576343,63140,3128346,60603,67742,106507,146947,1483695,73921,146949,3403977,189328,1736019,1734153,3424208,1483684,61632,3423055,63135,63227,63136,3403911,1734943,63790,63138]);galleries[299661]=new gallery(299661,"3128409","People","gallery",[3422718,3455336,4118029,3128409,63794,1107798,3397334,63144,1483703,1107786,1736022,1455875]);galleries[299660]=new gallery(299660,"3422715,3422711,3131339","Theatre","gallery",[3422711,3422715,3131339]);var imageSets=new Object();imageSets[1]="3422711,3397334,3128409,2576343,1483703,1107161,149133,67742";imageSets[2]="3128409";imageSets[3]="5324275,5324097,4118029,4118020,3455336,3424208,3423098,3423055,3422718,3422715,3422711,3422314,3403999,3403991,3403977,3403911,3403867,3403813,3397474,3397334,3397292,3397272,3397270,3397268,3396185,3396160,3396157,3131344,3131339,3130568,3130527,3130466,3128409,3128350,3128346,2576343,1766174,1736027,1736022,1736019,1735571,1734943,1734153,1483703,1483695,1483684,1455875,1455873,1107798,1107786";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/michael/images";break}switch(a){case 1:b="http://www1.clikpic.com/michael/images";break}switch(a){case 2:b="http://admin.clikpic.com/michael/images";break}switch(a){case 24:b="http://tpc15/clikpic/michael/images";break}switch(a){case 4:b="http://www.clikchurch.com/michael/images";break}switch(a){case 5:b="http://www2.clikpic.com/michael/images";break}switch(a){case 22:b="http://tpc5/clikpic/michael/images";break}switch(a){case 23:b="http://tpc10/clikpic/michael/images";break}switch(a){case 25:b="http://tpc16/clikpic/michael/images";break}switch(a){case 15:b="http://www3.clikpic.com/michael/images";break}switch(a){case 18:b="http://www4.clikpic.com/michael/images";break}switch(a){case 19:b="http://www5.clikpic.com/michael/images";break}switch(a){case 31:b="http://www7.clikpic.com/michael/images";break}switch(a){case 32:b="http://admin2.clikpic.com/michael/images";break}switch(a){case 33:b="http://www8.clikpic.com/michael/images";break}switch(a){case 34:b="http://www9.clikpic.com/michael/images";break}switch(a){case 35:b="http://admin3.clikpic.com/michael/images";break}switch(a){case 37:b="http://admin4.clikpic.com/michael/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="<b>michael farenden photography</b>: "+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>"}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+'")'})}}};