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[1811661]=new thumbnail(1811661,"","","intro5_thumb.jpg",130,87,15);thumbnails[1811668]=new thumbnail(1811668,"","","intro6_thumb.jpg",130,87,15);thumbnails[1811672]=new thumbnail(1811672,"","","intro7_thumb.jpg",130,87,15);thumbnails[1811675]=new thumbnail(1811675,"","","intro8_thumb.jpg",130,87,15);thumbnails[5452717]=new thumbnail(5452717,"","","mags3_thumb.jpg",130,37,15);thumbnails[5464168]=new thumbnail(5464168,"","","pix1_thumb.jpg",130,36,15);thumbnails[5500117]=new thumbnail(5500117,"","","copyright_thumb.jpg",130,37,15);thumbnails[5521004]=new thumbnail(5521004,"","","mags2_thumb.jpg",130,36,15);thumbnails[152146]=new thumbnail(152146,"14022","<b>BRM Camp</b>","BRMCamp_thumb.jpg",130,86,15);thumbnails[152148]=new thumbnail(152148,"14022","<b>Jim Clark</b>","clark_thumb.jpg",130,67,15);thumbnails[152152]=new thumbnail(152152,"14022","<b>British Grand Prix 1968</b>","McLaren1_thumb.jpg",130,87,15);thumbnails[152154]=new thumbnail(152154,"14022","<b>Mini Cooper</b>","Mini_thumb.jpg",130,81,15);thumbnails[152155]=new thumbnail(152155,"14022","<b>Jochen Rindt</b>","Rindt1_thumb.jpg",130,85,15);thumbnails[152156]=new thumbnail(152156,"14022","<b>Jo Siffert</b>","Siffert68_thumb.JPG",130,73,15);thumbnails[152161]=new thumbnail(152161,"14022","<b>Dawn at Le Mans</b>","gurney_thumb.jpg",130,80,15);thumbnails[178027]=new thumbnail(178027,"14022","<b>Graham Hill</b>","Hill68_thumb.jpg",130,68,15);thumbnails[857344]=new thumbnail(857344,"14022","<b>Graham Hill 1966</b>","Hill66_thumb.jpg",130,68,15);thumbnails[857349]=new thumbnail(857349,"14022","<b>Ford 3-litre V8</b>","Ford3l_thumb.jpg",130,70,15);thumbnails[878580]=new thumbnail(878580,"14022","<b>Chaparral 2F</b>","2E_thumb.jpg",130,73,15);thumbnails[879319]=new thumbnail(879319,"14022","<b>McLaren-Ford M9A</b>","Bell_thumb.jpg",130,59,15);thumbnails[151040]=new thumbnail(151040,"14178","<b>Niki Lauda</b>","Lauda77_thumb.jpg",130,97,15);thumbnails[152177]=new thumbnail(152177,"14178","<b>BOAC 1000Km</b>","BOAC500_thumb.jpg",130,86,15);thumbnails[152178]=new thumbnail(152178,"14178","<b>Emerson Fittipaldi</b>","EmmoAust_thumb.jpg",130,167,15);thumbnails[152181]=new thumbnail(152181,"14178","<b>Chris Amon</b>","Amon71_thumb.jpg",130,80,15);thumbnails[152183]=new thumbnail(152183,"14178","<b>Spanish GP</b>","Spain73_thumb.jpg",130,65,15);thumbnails[152189]=new thumbnail(152189,"14178","<b>Monaco GP</b>","Moaco73_thumb.jpg",130,186,15);thumbnails[152195]=new thumbnail(152195,"14178","<b>Howden Ganley</b>","Ganley_thumb.jpg",130,75,15);thumbnails[857321]=new thumbnail(857321,"14178","<b>Francois Cevert</b>","Cervert73_thumb.jpg",130,100,15);thumbnails[857324]=new thumbnail(857324,"14178","<b>German Grand Prix 1972</b>","GermanStart72_thumb.jpg",130,71,15);thumbnails[857326]=new thumbnail(857326,"14178","<b>James Hunt</b>","Hunt73_thumb.jpg",130,99,15);thumbnails[857342]=new thumbnail(857342,"14178","<b>Jean-Pierre Beltoise</b>","Beltoise1_thumb.jpg",130,85,15);thumbnails[881136]=new thumbnail(881136,"14178","<b>British GP 1970</b>","RindtBrnds_thumb.jpg",130,87,15);thumbnails[884542]=new thumbnail(884542,"14178","<b>GKN/Daily Express Trophy 1971<b/>","Start_thumb.jpg",130,87,15);thumbnails[151046]=new thumbnail(151046,"14031","<b>Jim Clark, Graham Hill & Colin Chapman</b>","LotusCamp_thumb.jpg",130,87,15);thumbnails[158655]=new thumbnail(158655,"14031","<b>Denny Hulme</b>","Denny_thumb.jpg",130,84,15);thumbnails[158661]=new thumbnail(158661,"14031","<b>Jacky Ickx</b>","Ickx_thumb.jpg",130,186,15);thumbnails[158671]=new thumbnail(158671,"14031","<b>Murray Walker & Barry Sheene</b>","Muray&Barry_thumb.jpg",130,221,15);thumbnails[158672]=new thumbnail(158672,"14031","<b>Ronnie Peterson</b>","Peterson_thumb.jpg",130,165,15);thumbnails[158674]=new thumbnail(158674,"14031","<b>Jochen Rindt</b>","RindtMug_thumb.jpg",130,79,15);thumbnails[158675]=new thumbnail(158675,"14031","<b>Pedro Rodriguez</b>","Pedro_thumb.jpg",130,87,15);thumbnails[158678]=new thumbnail(158678,"14031","<b>Jo Siffert</b>","Joe_thumb.jpg",130,194,15);thumbnails[158681]=new thumbnail(158681,"14031","<b>Jackie Stewart</b>","Stewart1_thumb.jpg",130,144,15);thumbnails[178028]=new thumbnail(178028,"14031","<b>Johnny Herbert</b>","Herbert_thumb.jpg",130,87,15);thumbnails[178030]=new thumbnail(178030,"14031","<b>Tony Brooks</b>","Brooks_thumb.jpg",130,81,15);thumbnails[199849]=new thumbnail(199849,"14031","<b>David Coulthard<b/>","coulthard_thumb.jpg",130,195,15);thumbnails[857431]=new thumbnail(857431,"14031","<b>Nigel Mansell</b>","mansell_thumb.jpg",130,87,15);thumbnails[881667]=new thumbnail(881667,"14031","<b>F1 Champions Plus</b>","3Champs_thumb.jpg",130,73,15);thumbnails[151045]=new thumbnail(151045,"14030","<b>Pau</b>","Pau_thumb.jpg",130,87,15);thumbnails[159058]=new thumbnail(159058,"14030","<b>Aston Martin DBR1</b>","Aston_thumb.jpg",130,87,15);thumbnails[159066]=new thumbnail(159066,"14030","<b>Pau Paddock</b>","PauPaddock_thumb.jpg",130,87,15);thumbnails[159070]=new thumbnail(159070,"14030","<b>1914 Mercedes</b>","merc_thumb.jpg",130,87,15);thumbnails[159079]=new thumbnail(159079,"14030","<b>Palermo P3</b>","P3_thumb.jpg",130,87,15);thumbnails[170590]=new thumbnail(170590,"14030","<b>Red Bull</b>","redbull_thumb.jpg",130,87,15);thumbnails[176325]=new thumbnail(176325,"14030","<b>Bentley Speed 8</b>","Bently_thumb.jpg",130,74,15);thumbnails[176340]=new thumbnail(176340,"14030","<b>Bugatti Type 51</b>","Bugatti_thumb.jpg",130,87,15);thumbnails[176348]=new thumbnail(176348,"14030","<b>Ferrari 2002 F1</b>","donut_thumb.jpg",130,65,15);thumbnails[176359]=new thumbnail(176359,"14030","<b>Lagonda V12 Le Mans</b>","Cafe_thumb.jpg",130,212,15);thumbnails[199861]=new thumbnail(199861,"14030","<b>Jack Brabham<b/>","brabham2000_thumb.jpg",130,70,15);thumbnails[770563]=new thumbnail(770563,"14030","<b>Lister Jag</b>","Lister_thumb.jpg",130,87,15);thumbnails[857497]=new thumbnail(857497,"14030","<b>Goodwood Revival 2006, ST.Mary's Trophy</b>","SaloonStart_thumb.jpg",130,65,15);thumbnails[857511]=new thumbnail(857511,"14030","<b>Moss at Monaco 2006</b>","MossMon2_thumb.jpg",130,87,15);thumbnails[867230]=new thumbnail(867230,"14030","<b>Close Racing</b>","2 by 2_thumb.jpg",130,87,15);thumbnails[881634]=new thumbnail(881634,"14030","<b>Austin A35</b>","A35-2_thumb.jpg",130,87,15);var galleries=new Object();galleries[14022]=new gallery(14022,"879319,878580,857349,857344,178027,152161,152156,152155,152154,152152","<b>1960's</b>","gallery",[152146,152148,152152,152154,152155,152156,152161,178027,857344,857349,878580,879319]);galleries[14178]=new gallery(14178,"884542,881136,857342,857326,857324,857321,152195,152189,152183,152181","<b>1970's</b>","gallery",[151040,152177,152178,152181,152183,152189,152195,857321,857324,857326,857342,881136,884542]);galleries[14031]=new gallery(14031,"881667,857431,199849,178030,178028,158681,158678,158675,158674,158672","<b>Portraits & Personalities</b>","gallery",[151046,158655,158661,158671,158672,158674,158675,158678,158681,178028,178030,199849,857431,881667]);galleries[14030]=new gallery(14030,"881634,867230,857511,857497,770563,199861,176359,176348,176340,176325","<b>Today's Historic Racing</b>","gallery",[151045,159058,159066,159070,159079,170590,176325,176340,176348,176359,199861,770563,857497,857511,867230,881634]);var imageSets=new Object();imageSets[1]="1811675,1811672,1811668,1811661";imageSets[3]="5521004,5500117,5464168,5452717,1811675,1811672,1811668,1811661,884542,881667,881634,881136,879319,878580,867230,857511,857497,857431,857349,857344,857342,857326,857324,857321,770563,199861,199849,178030,178028,178027,176359,176348,176340,176325,170590,159079,159070,159066,159058,158681,158678,158675,158674,158672,158671,158661,158655,152195,152189,152183";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/rogerdixon/images";break}switch(a){case 1:b="http://www1.clikpic.com/rogerdixon/images";break}switch(a){case 2:b="http://admin.clikpic.com/rogerdixon/images";break}switch(a){case 24:b="http://tpc15/clikpic/rogerdixon/images";break}switch(a){case 4:b="http://www.clikchurch.com/rogerdixon/images";break}switch(a){case 5:b="http://www2.clikpic.com/rogerdixon/images";break}switch(a){case 22:b="http://tpc5/clikpic/rogerdixon/images";break}switch(a){case 23:b="http://tpc10/clikpic/rogerdixon/images";break}switch(a){case 25:b="http://tpc16/clikpic/rogerdixon/images";break}switch(a){case 15:b="http://www3.clikpic.com/rogerdixon/images";break}switch(a){case 18:b="http://www4.clikpic.com/rogerdixon/images";break}switch(a){case 19:b="http://www5.clikpic.com/rogerdixon/images";break}switch(a){case 31:b="http://www7.clikpic.com/rogerdixon/images";break}switch(a){case 32:b="http://admin2.clikpic.com/rogerdixon/images";break}switch(a){case 33:b="http://www8.clikpic.com/rogerdixon/images";break}switch(a){case 34:b="http://www9.clikpic.com/rogerdixon/images";break}switch(a){case 35:b="http://admin3.clikpic.com/rogerdixon/images";break}switch(a){case 37:b="http://admin4.clikpic.com/rogerdixon/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="'+escape(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="Roger Dixon   Historic-Motorsport Photojournalist.: "+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="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+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="item_name" value="'+e+'">';ref="";if(c.photo_ref!=""){ref=c.photo_ref+" - "+c.caption}else{ref=c.id+" - "+c.caption}price=d;b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="roger@thedixons.co.uk">';b=b+'<input type="hidden" name="currency_code" value="GBP">';b=b+'<input type="hidden" name="add" value="1">';b=b+'<input type="hidden" name="amount" value="'+d+'">';b=b+'<input type="hidden" name="item_number" value="'+ref+'">';b=b+'<input type="Submit" value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";b=b+'<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="roger@thedixons.co.uk">';b=b+'<input type="hidden" name="display" value="1">';b=b+'<input type="Submit" value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";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+'")'})}}};