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[925824]=new thumbnail(925824,"70405","Remembrance Sunday.","queen_website_01_thumb.jpg",69,100,18);thumbnails[927092]=new thumbnail(927092,"70405","George Michael leaves Brent Magistrates Court. ","070608_JSB_george_michael_10_thumb.jpg",130,86,18);thumbnails[927095]=new thumbnail(927095,"70405","Waves batter Dawlish.","080905_JSB_weather_05_thumb.JPG",130,86,18);thumbnails[927043]=new thumbnail(927043,"70405","Pregnant Natasha Kaplinsky at the fair. ","kaplinsky_website_01_thumb.jpg",130,91,18);thumbnails[925877]=new thumbnail(925877,"70405","British actor Daniel Craig","081029_JSB_bond_prem_09_thumb.JPG",63,100,18);thumbnails[927071]=new thumbnail(927071,"70405","A light aircraft crashes into a house.<br>\r\n<br>\r\n","010402 KNP crash 02 copy_thumb.jpe",130,87,18);thumbnails[926660]=new thumbnail(926660,"70405","Gordon Brown.","brown_001_thumb.jpg",74,100,18);thumbnails[927076]=new thumbnail(927076,"70405","The Colonel's Review.","guard_01_thumb.jpg",130,87,18);thumbnails[927042]=new thumbnail(927042,"70405","Maldon Mud Race.","090104_JSB_maldon_mud_race_05_thumb.JPG",59,100,18);thumbnails[926688]=new thumbnail(926688,"70405","Police on Space Hoppers.","070528_JSB_bank_holiday_01_thumb.jpg",130,87,18);thumbnails[930459]=new thumbnail(930459,"70405","British summer...","080709_JSB_weather_05_thumb.JPG",130,87,18);thumbnails[928165]=new thumbnail(928165,"70405","Timber washed ashore at Worthing, West Sussex.","timber_001_thumb.jpg",130,87,18);thumbnails[930387]=new thumbnail(930387,"70772","Neil Lenham joins Newbery","090212_JSB_newbery_012_thumb.jpg",130,87,18);thumbnails[930389]=new thumbnail(930389,"70772","Gisele sports a Ebel watch","070619_JSB_gisele_01_thumb.JPG",67,100,18);thumbnails[930393]=new thumbnail(930393,"70772","Mike Ear assembly service","061020_JSB_mike_ear_05_thumb.JPG",130,87,18);thumbnails[930395]=new thumbnail(930395,"70772","New MV Agusta 1000cc. ","050315_JSB_gordon_alane_08_thumb.JPG",67,100,18);thumbnails[930403]=new thumbnail(930403,"70772","Andrea Rozario of Rozario Harris & Co.","061123_JSB_andrea_rozario_04_thumb.JPG",130,87,18);thumbnails[930416]=new thumbnail(930416,"70772","Poppy","JSB_poppy_12_thumb.JPG",70,100,18);thumbnails[930418]=new thumbnail(930418,"70772","Coastway Veterinary Group.","coastway_1614_thumb.jpg",130,87,18);thumbnails[929214]=new thumbnail(929214,"70772","Emma Bunton launches Celeb mag","JSB_emma_bunton_12_thumb.JPG",80,100,18);thumbnails[930423]=new thumbnail(930423,"70772","geeks on wheels.","JSB_4107_thumb.JPG",130,88,18);thumbnails[930439]=new thumbnail(930439,"70772","Fatboy Slim launches Palookaville","JSB_fatboy_04_thumb.JPG",67,100,18);thumbnails[930448]=new thumbnail(930448,"70772","Nestle Ice Cream.","JSB_hot_weather_04_thumb.JPG",130,87,18);thumbnails[926730]=new thumbnail(926730,"70772","Sames LTD at Lords Cricket ground","JSB_lords_05_thumb.JPG",130,87,18);thumbnails[927139]=new thumbnail(927139,"70528","Models at London's Alternative Fashion Week.<br>\r\n","080421_JSB_alternative_fashion_021_thumb.JPG",130,87,18);thumbnails[927125]=new thumbnail(927125,"70528","Jet perform at the Brixton Academy, London.","JSB jet live 02_thumb.jpg",130,86,18);thumbnails[926045]=new thumbnail(926045,"70528","Radio and television broadcaster John Inverdale","081112_JSB_john_inverdale_03_thumb.JPG",64,100,18);thumbnails[927083]=new thumbnail(927083,"70528","Bill of Bills.","bill_website_01_thumb.jpg",130,87,18);thumbnails[927149]=new thumbnail(927149,"70528","Tornado crosses the Thames at Barnes bridge.","090215_JSB_steam_train_02_thumb.jpg",130,87,18);thumbnails[927135]=new thumbnail(927135,"70528","Phil Vickery out walking in Gloucestershire.","050831_JSB_phil_vickery_011_thumb.jpg",130,87,18);thumbnails[927206]=new thumbnail(927206,"70528","Newspaper editor Kelvin MacKenzie.","081121_JSB_kelvin_mackenzie_03__thumb.JPG",66,100,18);thumbnails[927117]=new thumbnail(927117,"70528","Clowns sitting back stage.","070705_JSB_zippos_circus_02_thumb.jpg",130,87,18);thumbnails[928164]=new thumbnail(928164,"70528","Sarah Palin bonfire effigy.<br>\r\n<br>\r\n","081001_JSB_bonfire_effigy_03_thumb.JPG",130,87,18);thumbnails[927215]=new thumbnail(927215,"70528","'The Apprentice' Michelle Dewberry.","michelle_website_01_thumb.jpg",130,87,18);thumbnails[930474]=new thumbnail(930474,"70528","Nancy Sorrell at home.","050310_JSB_nancy_11copy1_thumb.jpg",67,100,18);thumbnails[927141]=new thumbnail(927141,"70528","Shell oil droplets","081030_JSB_shell_oil_031_thumb.JPG",130,87,18);thumbnails[926612]=new thumbnail(926612,"70459","Kent V Hampshire at the St Lawrence Ground.<br>\r\n","070525_JSB_kent_hampshire_01_thumb.jpg",130,86,18);thumbnails[929922]=new thumbnail(929922,"70459","Crystal Palace V Hull City at Sellhurst Park.","070120_JSB_palace_hull_13_thumb.jpg",130,84,18);thumbnails[926614]=new thumbnail(926614,"70459","Jason Euell celebrates scoring.","football_website_01_thumb.jpg",65,100,18);thumbnails[926629]=new thumbnail(926629,"70459","Racing at Brighton.","racing_website_01_thumb.jpg",130,87,18);thumbnails[926622]=new thumbnail(926622,"70459","Backstage with Ronnie O'Sullivan. ","JSB snooker open 61_thumb.jpg",130,86,18);thumbnails[927183]=new thumbnail(927183,"70459","Freddy Flintoff has a net at the County Ground Hove.","080702_andrew_flintoff_09_thumb.JPG",130,83,18);thumbnails[929940]=new thumbnail(929940,"70459","Sussex's Luke Wright ","090409_JSB_sussex_kent_02_thumb.jpg",64,100,18);thumbnails[926613]=new thumbnail(926613,"70459","Jason Lewry clean bowls Craig Spearman.","050817_JSB_frizzell_01_thumb.jpg",130,81,18);thumbnails[3656019]=new thumbnail(3656019,"70459","Southampton V Bristol City.","wright_phillips_thumb.jpg",130,90,18);thumbnails[929928]=new thumbnail(929928,"70459","Freddy get the teas.","070530_JSB_freddy_flintoff_03_thumb.JPG",62,100,18);thumbnails[929903]=new thumbnail(929903,"70459","Frankie Dettori's 100 win","JSB dettori 01_thumb.jpg",130,87,18);thumbnails[3656026]=new thumbnail(3656026,"70459","Mushtaq Ahmed appeals.","mush_thumb.jpg",114,100,18);thumbnails[956160]=new thumbnail(956160,"70568","Zara Phillips<br>\r\n","zara_thumb.jpg",130,85,18);thumbnails[929739]=new thumbnail(929739,"70568","Badminton Horse Trials.","JSB badminton 03_thumb.jpg",68,100,18);thumbnails[956168]=new thumbnail(956168,"70568","Katie Price at Hickstead.<br>\r\n","jordan_001_thumb.jpg",65,100,18);thumbnails[3656295]=new thumbnail(3656295,"70568","Jodie Kidd training at Hickstead.","kidd_001_thumb.jpg",130,87,18);thumbnails[956249]=new thumbnail(956249,"70568","Hacking on the South Downs<br>\r\n","rapeseeed_01_thumb.jpg",130,84,18);thumbnails[929908]=new thumbnail(929908,"70568","Jodie Kidd. ","081124_JSB_jodie_kidd_11_thumb.JPG",130,86,18);thumbnails[956170]=new thumbnail(956170,"70568","Emily butcher and Southern Ben. <br>\r\n","badminton_01_thumb.jpg",130,86,18);thumbnails[3656486]=new thumbnail(3656486,"70568","Konik Horses.","konik_01_thumb.jpg",130,87,18);thumbnails[3656459]=new thumbnail(3656459,"70568","Hercules.","GLAD_MUD_01_thumb.jpg",130,87,18);thumbnails[3656533]=new thumbnail(3656533,"70568","Wedding Unicorn.","merton_01_thumb.jpg",70,100,18);thumbnails[3656571]=new thumbnail(3656571,"70568","Paul Gaff and Alvescot Peppermint.","paul_gaff_01_thumb.jpg",66,100,18);thumbnails[3656752]=new thumbnail(3656752,"70568","Zippo's Circus.","zippos_thumb.jpg",130,87,18);var galleries=new Object();galleries[70405]=new gallery(70405,"927042","News","gallery",[925824,927092,927095,927043,925877,927071,926660,927076,927042,926688,930459,928165]);galleries[70772]=new gallery(70772,"930387","Corporate","gallery",[930387,930389,930393,930395,930403,930416,930418,929214,930423,930439,930448,926730]);galleries[70528]=new gallery(70528,"927149,927083","Features","gallery",[927139,927125,926045,927083,927149,927135,927206,927117,928164,927215,930474,927141]);galleries[70459]=new gallery(70459,"3656019","Sport","gallery",[926612,929922,926614,926629,926622,927183,929940,926613,3656019,929928,929903,3656026]);galleries[70568]=new gallery(70568,"929908","Equestrian","gallery",[956160,929739,956168,3656295,956249,929908,956170,3656486,3656459,3656533,3656571,3656752]);var imageSets=new Object();imageSets[1]="930423,930416,930389,929928,929908,929214,927141,927139,927095,927042,926045,925877";imageSets[2]="3656019,930387,929908,927149,927083,927042";imageSets[3]="3656752,3656571,3656533,3656486,3656459,3656295,3656026,3656019,956249,956170,956168,956160,930474,930459,930448,930439,930423,930418,930416,930403,930395,930393,930389,930387,929940,929928,929922,929908,929903,929739,929214,928165,928164,927215,927206,927183,927149,927141,927139,927135,927125,927117,927095,927092,927083,927076,927071,927043,927042,926730";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/jamesboardman/images";break}switch(a){case 1:b="http://www1.clikpic.com/jamesboardman/images";break}switch(a){case 2:b="http://admin.clikpic.com/jamesboardman/images";break}switch(a){case 4:b="http://www.clikchurch.com/jamesboardman/images";break}switch(a){case 5:b="http://www2.clikpic.com/jamesboardman/images";break}switch(a){case 15:b="http://www3.clikpic.com/jamesboardman/images";break}switch(a){case 21:b="http://www6.clikpic.com/jamesboardman/images";break}switch(a){case 18:b="http://www4.clikpic.com/jamesboardman/images";break}switch(a){case 19:b="http://www5.clikpic.com/jamesboardman/images";break}switch(a){case 22:b="http://tpc5/clikpic/jamesboardman/images";break}switch(a){case 23:b="http://tpc10/clikpic/jamesboardman/images";break}switch(a){case 24:b="http://tpc15/clikpic/jamesboardman/images";break}switch(a){case 25:b="http://tpc16/clikpic/jamesboardman/images";break}switch(a){case 31:b="http://www7.clikpic.com/jamesboardman/images";break}switch(a){case 32:b="http://admin2.clikpic.com/jamesboardman/images";break}switch(a){case 33:b="http://www8.clikpic.com/jamesboardman/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="james boardman photography: "+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+"</p>";var e=c.purchase_instruction;var d=c.item_price;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+'")'})}}};