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[2666672]=new thumbnail(2666672,"","","Danebury_Logo_Website_thumb.jpg",130,169,5);thumbnails[2667942]=new thumbnail(2667942,"","","Me_thumb.jpg",130,143,5);thumbnails[2668067]=new thumbnail(2668067,"","","Basil_thumb.JPG",130,144,5);thumbnails[2668072]=new thumbnail(2668072,"","","Alf_thumb.JPG",130,152,5);thumbnails[2668075]=new thumbnail(2668075,"","","Betty_thumb.JPG",130,124,5);thumbnails[2669290]=new thumbnail(2669290,"","","Alfie Start Marshall_thumb.jpg",130,163,5);thumbnails[2669294]=new thumbnail(2669294,"","","Marshalls_thumb.jpg",130,49,5);thumbnails[2669826]=new thumbnail(2669826,"","","Location Map_thumb.JPG",130,90,5);thumbnails[4091237]=new thumbnail(4091237,"","The one and only time you'll see Karen on a sidecar!","Amesbury_Carnival_2009_01_thumb.jpg",130,82,5);thumbnails[4091295]=new thumbnail(4091295,"","The Float","Amesbury_Carnival_2009_02_thumb.jpg",130,83,5);thumbnails[4091334]=new thumbnail(4091334,"","The Float Again","Amesbury_Carnival_2009_03_thumb.jpg",130,80,5);thumbnails[4091344]=new thumbnail(4091344,"","Betty, where's your driver?!","Amesbury_Carnival_2009_04_thumb.jpg",130,87,5);thumbnails[4091351]=new thumbnail(4091351,"","What a cool little sidecar!","Amesbury_Carnival_2009_05_thumb.jpg",130,121,5);thumbnails[4868092]=new thumbnail(4868092,"","","Map_thumb.jpg",130,99,5);thumbnails[4875209]=new thumbnail(4875209,"","","Field_001_thumb.jpg",130,98,5);thumbnails[4875211]=new thumbnail(4875211,"","","Field_002_thumb.jpg",130,98,5);thumbnails[4940086]=new thumbnail(4940086,"282115","Auto Cadet Champion - Tom Brennan","Auto_Cadet_Tom_Brennan_thumb.jpg",130,87,5);thumbnails[4940087]=new thumbnail(4940087,"282115","Cadet Champion - Edmund Best","Cadet_Edmund_Best_thumb.jpg",130,87,5);thumbnails[4940089]=new thumbnail(4940089,"282115","Inter 85MX Champion - Sam Morgan","Inter_85MX_Sam_Morgan_thumb.jpg",130,87,5);thumbnails[4940090]=new thumbnail(4940090,"282115","Intermediate Champion - Oliver Greenwood","Intermediate_Oliver_Greenwood_thumb.jpg",130,86,5);thumbnails[4940091]=new thumbnail(4940091,"282115","International 125cc Champion - Craig Drury","International_125_Craig_Drury_thumb.jpg",130,87,5);thumbnails[4940176]=new thumbnail(4940176,"282115","Junior 65MX Champion - Edmund Best","Junior_65MX_Edmund_Best_thumb.jpg",130,87,5);thumbnails[4940289]=new thumbnail(4940289,"282115","Junior Champion - Robert Lambert","Junior_Robert_Lambert_thumb.jpg",130,87,5);thumbnails[4940393]=new thumbnail(4940393,"282115","Senior 85MX Champion - Jordan Holliday","Senior_85MX_Jordan_Holliday_thumb.jpg",130,117,5);thumbnails[4940394]=new thumbnail(4940394,"282115","Senior A Champion - Josh Dingle","Senior_A_Josh_Dingle_thumb.jpg",130,87,5);thumbnails[4940395]=new thumbnail(4940395,"282115","Senior B Champion - Craig Drury","Senior_B_Craig_Drury_thumb.jpg",130,87,5);thumbnails[4940397]=new thumbnail(4940397,"282117","250cc Solo Champion - Harland Cook","250_Harland_Cook_thumb.jpg",130,86,5);thumbnails[4940398]=new thumbnail(4940398,"282117","350cc Solo Champion - Nathan Irwin","350_Nathan_Irwin_thumb.jpg",130,87,5);thumbnails[4940399]=new thumbnail(4940399,"282117","500cc Solo Champion - Harland Cook","500_Harland_Cook_thumb.jpg",130,86,5);thumbnails[4940400]=new thumbnail(4940400,"282117","1000cc Sidecar Champions - Neal Owen & Kevin Colborne","1000_SC_Neal_Owen_thumb.jpg",130,87,5);thumbnails[4940401]=new thumbnail(4940401,"282117","Upright Solo Champion - Ian Gutteridge","Upright_Ian_Gutteridge_thumb.jpg",130,87,5);thumbnails[3442211]=new thumbnail(3442211,"210594","Hard at Work ... ?? You Little Devil!","The Devil 1_thumb.jpg",130,119,5);thumbnails[3442239]=new thumbnail(3442239,"168703","","JH 1 Protected_thumb.jpg",130,94,5);thumbnails[3442246]=new thumbnail(3442246,"168703","","JH Protected_thumb.jpg",130,198,5);thumbnails[2668909]=new thumbnail(2668909,"168702","Andy Heitman","Quad Rider_thumb.jpg",130,98,5);thumbnails[2669014]=new thumbnail(2669014,"168702","Rachel Mothersole","DGT_-36_thumb.jpg",130,104,5);thumbnails[2669119]=new thumbnail(2669119,"168702","","Sidecar Rider_thumb.jpg",130,86,5);thumbnails[2669161]=new thumbnail(2669161,"168702","Barry Powell","DGT_-30_thumb.jpg",130,88,5);thumbnails[2669397]=new thumbnail(2669397,"168702","James Peters","James Peters_thumb.JPG",130,110,5);thumbnails[2669470]=new thumbnail(2669470,"168702","Charlie Saunders","Charlie Saunders_thumb.jpg",130,109,5);thumbnails[2669481]=new thumbnail(2669481,"168702","Dean Garton","Dean Garton_thumb.jpg",130,112,5);thumbnails[2669485]=new thumbnail(2669485,"168702","Keith Richards & Jake Cutler","Keith Richards_thumb.jpg",130,93,5);thumbnails[2669488]=new thumbnail(2669488,"168702","Peter Langran & Rob Clementson","Peter Langran_thumb.jpg",130,90,5);thumbnails[2669491]=new thumbnail(2669491,"168702","","Sidecar Start_thumb.jpg",130,58,5);thumbnails[2669589]=new thumbnail(2669589,"168702","Andy Gribble & David Williams","Andy Gribble_thumb.JPG",130,120,5);thumbnails[2669644]=new thumbnail(2669644,"168702","George Penfold & Paul Marley","George Penfold_thumb.JPG",130,105,5);thumbnails[2669648]=new thumbnail(2669648,"168702","John Jefferies","John Jefferies_thumb.JPG",130,94,5);thumbnails[2669650]=new thumbnail(2669650,"168702","John Weeks","John Weeks_thumb.JPG",130,103,5);thumbnails[2669662]=new thumbnail(2669662,"168702","Matt Fumarola & Andy Wilson","Matt Fumarola_thumb.JPG",130,90,5);thumbnails[2669683]=new thumbnail(2669683,"168702","Mike & Simon Elliott","Mike Elliott_thumb.JPG",130,119,5);thumbnails[2669688]=new thumbnail(2669688,"168702","","Red Sidecar_thumb.JPG",130,109,5);thumbnails[2669690]=new thumbnail(2669690,"168702","Santa and Rudolph!","Santa_thumb.JPG",130,101,5);thumbnails[2669694]=new thumbnail(2669694,"168702","Stephen Gale","Stephen Gale_thumb.JPG",130,111,5);var galleries=new Object();galleries[282115]=new gallery(282115,"4940395,4940394,4940393,4940289,4940176,4940091,4940090,4940089,4940087,4940086","2009 British Youth Grasstrack Racing Championship","gallery",[4940086,4940087,4940089,4940090,4940091,4940176,4940289,4940393,4940394,4940395]);galleries[282117]=new gallery(282117,"4940401,4940400,4940399,4940398,4940397","2009 Southern Centre Championships","gallery",[4940397,4940398,4940399,4940400,4940401]);galleries[210594]=new gallery(210594,"3442211","2009 Burnfield New Year Spinner","gallery",[3442211]);galleries[168703]=new gallery(168703,"3442246,3442239","2008 Southern Centre Championships","gallery",[3442239,3442246]);galleries[168702]=new gallery(168702,"2669694,2669690,2669688,2669683,2669662,2669650,2669648,2669644,2669589,2669491","2008 Burnfield New Year Spinner","gallery",[2668909,2669014,2669119,2669161,2669397,2669470,2669481,2669485,2669488,2669491,2669589,2669644,2669648,2669650,2669662,2669683,2669688,2669690,2669694]);var imageSets=new Object();imageSets[1]="2666672";imageSets[3]="4940401,4940400,4940399,4940398,4940397,4940395,4940394,4940393,4940289,4940176,4940091,4940090,4940089,4940087,4940086,4875211,4875209,4868092,4091351,4091344,4091334,4091295,4091237,3442246,3442239,3442211,2669826,2669694,2669690,2669688,2669683,2669662,2669650,2669648,2669644,2669589,2669491,2669488,2669485,2669481,2669470,2669397,2669294,2669290,2669161,2669119,2669014,2668909,2668075,2668072";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/Daneburygtrc/images";break}switch(a){case 1:b="http://www1.clikpic.com/Daneburygtrc/images";break}switch(a){case 2:b="http://admin.clikpic.com/Daneburygtrc/images";break}switch(a){case 24:b="http://tpc15/clikpic/Daneburygtrc/images";break}switch(a){case 4:b="http://www.clikchurch.com/Daneburygtrc/images";break}switch(a){case 5:b="http://www2.clikpic.com/Daneburygtrc/images";break}switch(a){case 22:b="http://tpc5/clikpic/Daneburygtrc/images";break}switch(a){case 23:b="http://tpc10/clikpic/Daneburygtrc/images";break}switch(a){case 25:b="http://tpc16/clikpic/Daneburygtrc/images";break}switch(a){case 15:b="http://www3.clikpic.com/Daneburygtrc/images";break}switch(a){case 18:b="http://www4.clikpic.com/Daneburygtrc/images";break}switch(a){case 19:b="http://www5.clikpic.com/Daneburygtrc/images";break}switch(a){case 31:b="http://www7.clikpic.com/Daneburygtrc/images";break}switch(a){case 32:b="http://admin2.clikpic.com/Daneburygtrc/images";break}switch(a){case 33:b="http://www8.clikpic.com/Daneburygtrc/images";break}switch(a){case 34:b="http://www9.clikpic.com/Daneburygtrc/images";break}switch(a){case 35:b="http://admin3.clikpic.com/Daneburygtrc/images";break}switch(a){case 37:b="http://admin4.clikpic.com/Daneburygtrc/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="Danebury Grasstrack Racing Club: "+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+'")'})}}};