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[5570667]=new thumbnail(5570667,"315986","Ford Escort RS Cosworth","escort_cos_thumb.jpg",130,81,1);thumbnails[5570682]=new thumbnail(5570682,"315986","Ford Escort RS","escort_kerrigde_thumb.jpg",130,62,1);thumbnails[5570711]=new thumbnail(5570711,"315986","Ford Escort RS","escort_mk270001_thumb.jpg",130,84,1);thumbnails[5570776]=new thumbnail(5570776,"315986","MG Metro 6R4","Metro_thumb.jpg",130,93,1);thumbnails[5570785]=new thumbnail(5570785,"315986","Peugeot 205 GTI 1.6","pug_woodpecker_thumb.jpg",130,84,1);thumbnails[5570810]=new thumbnail(5570810,"315986","Ford Escort RS","red_escort_thumb.jpg",130,67,1);thumbnails[5570832]=new thumbnail(5570832,"315986","Toyota Corolla AE86","toyota_manx_thumb.jpg",130,83,1);thumbnails[5574553]=new thumbnail(5574553,"315986","Peugeot 205 GTI 1.9","Down_Amp_thumb.jpg",130,75,1);thumbnails[1370153]=new thumbnail(1370153,"95688","Skoda Fabia WRC. Toni Gardermister","skoda felicia copy_thumb.jpg",130,74,1);thumbnails[1370159]=new thumbnail(1370159,"95688","Computervision Metro 6R4. David Llewellin","metro 6r4 copy_thumb.jpg",130,77,1);thumbnails[1370171]=new thumbnail(1370171,"95688","Andrews Heat for Hire Opel Manta. Russell Brookes","manta copy_thumb.jpg",130,56,1);thumbnails[1387287]=new thumbnail(1387287,"95688","Toyota Celica. Juha Kankkunen","celica copy_thumb.jpg",130,54,1);thumbnails[1519113]=new thumbnail(1519113,"95688","Subaru Impreza WRC. Richard Burns","New Impreza copy_thumb.jpg",130,51,1);thumbnails[1662075]=new thumbnail(1662075,"95688","Spectator Pack. Click on Image to Buy","P1000218_thumb.JPG",130,98,1);thumbnails[1370147]=new thumbnail(1370147,"95686","Martini Lancia Delta. Didier Auriol","lancia delta copy_thumb.jpg",130,60,1);thumbnails[1370156]=new thumbnail(1370156,"95686","Lancia Stratos. Munari","Lancia stratos copy_thumb.jpg",130,53,1);thumbnails[1370158]=new thumbnail(1370158,"95686","Peugeot Cosworth. Andy Burton","peugeot cosworth copy_thumb.jpg",130,62,1);thumbnails[1519124]=new thumbnail(1519124,"95686","Peugeot 206 WRC. Marcuus Gronholm","pug 206_thumb.jpg",130,60,1);thumbnails[1589229]=new thumbnail(1589229,"95686","Audi Quattro S1. Hannu Mikkola","AudiS1 copy_thumb.jpg",130,55,1);thumbnails[1662076]=new thumbnail(1662076,"95686","Classic Pack. Click on Image to Buy","P1000216_thumb.JPG",130,98,1);thumbnails[1370161]=new thumbnail(1370161,"95694","Ford Focus WRC. Colin McRae","focus copy_thumb.jpg",130,54,1);thumbnails[1370163]=new thumbnail(1370163,"95694","Eaton Yale Ford Escort. Bjorn Waldergaard","mk2 escort copy_thumb.jpg",130,66,1);thumbnails[1370186]=new thumbnail(1370186,"95694","Hyundai Accent WRC. Damian Cole","hyundai cole copy_thumb.jpg",130,62,1);thumbnails[1519108]=new thumbnail(1519108,"95694","Lancia 037. Jolly Club","lancia 037 copy_thumb.jpg",130,61,1);thumbnails[1519116]=new thumbnail(1519116,"95694","Porsche 911. Rothmans Livery","porsche copy_thumb.jpg",130,53,1);thumbnails[1662077]=new thumbnail(1662077,"95694","Drivers Pack. Click on Image to Buy","P1000217_thumb.JPG",130,98,1);thumbnails[1370148]=new thumbnail(1370148,"95693","Mitsubishi WRC. Gigi Galli","mitsi_thumb.jpg",130,55,1);thumbnails[1370168]=new thumbnail(1370168,"95693","Audi Quattro. Hannu Mikkola","audi_thumb.gif",130,56,1);thumbnails[1370174]=new thumbnail(1370174,"95693","Triumph TR7. Tony Pond","tr7_thumb.jpg",130,61,1);thumbnails[1370180]=new thumbnail(1370180,"95693","Citroen Xsara WRC. Colin McRae","xsara_thumb.jpg",130,59,1);thumbnails[1387291]=new thumbnail(1387291,"95693","Suzuki Swift S1600. Guy Wilks","swift_thumb.jpg",130,76,1);thumbnails[1519089]=new thumbnail(1519089,"95693","Subaru Impreza 555. Colin McRae","555 sub copy_thumb.jpg",130,60,1);thumbnails[1519093]=new thumbnail(1519093,"95693","Toyota Corolla WRC. Carlos Sainz","corolla copy_thumb.jpg",130,61,1);thumbnails[1519096]=new thumbnail(1519096,"95693","Ford Escort Cosworth. Francois Delecour","esc cosw copy_thumb.jpg",130,60,1);thumbnails[1519104]=new thumbnail(1519104,"95693","Hyundai Accent WRC. Alister McRae","hyundai mcrae copy_thumb.jpg",130,85,1);thumbnails[1519120]=new thumbnail(1519120,"95693","Peugeot 205 T16. Ari Vatanen","pug205 t16 copy_thumb.jpg",130,66,1);thumbnails[1519126]=new thumbnail(1519126,"95693","Renault 5 Turbo. Jean Ragnotti","renault 5 copy_thumb.jpg",130,64,1);thumbnails[1519127]=new thumbnail(1519127,"95693","Ford RS200. Belga Rally Team","rs200 copy_thumb.jpg",130,75,1);thumbnails[1519129]=new thumbnail(1519129,"95693","Ford Sierra Cosworth. Jimmy McRae","sierra cos copy_thumb.jpg",130,72,1);thumbnails[1519135]=new thumbnail(1519135,"95693","Talbot Sunbeam. Henri Toivonen","sunbeam copy_thumb.jpg",130,62,1);thumbnails[1613360]=new thumbnail(1613360,"95693","Vauxhall Chevette HSR. Jimmy McRae","chevette copy_thumb.jpg",130,63,1);thumbnails[1636074]=new thumbnail(1636074,"95693","Peugeot 205 GTi. Richard Burns","Copy of 205 Burns  copy_thumb.jpg",130,61,1);thumbnails[1666367]=new thumbnail(1666367,"95693","Vauxhall Nova. Dave Metcalfe","Nova copy_thumb.jpg",130,70,1);thumbnails[1745709]=new thumbnail(1745709,"95693","Ford Focus 07. Mikko Hirvonen","Focus 07 copy_thumb.jpg",130,63,1);thumbnails[1745712]=new thumbnail(1745712,"95693","Roger Clark. Uniflow Ford Escort 1972 RAC Rally","mk1 escort copy_thumb.jpg",130,72,1);thumbnails[1786645]=new thumbnail(1786645,"95693","Ford Escort Mk2. Mark Ellis","ellis escort copy_thumb.jpg",130,61,1);thumbnails[3139453]=new thumbnail(3139453,"95693","Alan Cookson. Subaru Impreza WRC","Cookson Subaru WRC 98_thumb.jpg",130,57,1);thumbnails[3139457]=new thumbnail(3139457,"95693","Nik Elsmore. Mitsubishi Lancer EvoIX","Elsmore Evo9_thumb.jpg",130,64,1);thumbnails[3139460]=new thumbnail(3139460,"95693","Huw Evans. TQ Impreza N14","Evans TQ Subaru N14_thumb.jpg",130,68,1);thumbnails[3139463]=new thumbnail(3139463,"95693","Nigel Griffiths. Tesco 99 Impreza","Griffith Subaru_thumb.jpg",130,80,1);thumbnails[3139468]=new thumbnail(3139468,"95693","Colin Mcrae. Subaru Impreza WRC","Impreza WRC98_thumb.jpg",130,62,1);thumbnails[3139472]=new thumbnail(3139472,"95693","Stephen Moore. Focus WRC","Moore Focus 2007_thumb.jpg",130,62,1);thumbnails[3139475]=new thumbnail(3139475,"95693","Tony Pond. Computervision Metro 6R4","Pond Metro 6r4_thumb.jpg",130,69,1);thumbnails[3139482]=new thumbnail(3139482,"95693","Gardner S1400 Astra","Spud 1400 Astra_thumb.jpg",130,81,1);thumbnails[3139488]=new thumbnail(3139488,"95693","Brendan Wellman. Micra Kit Car","Wellman Micra_thumb.jpg",130,66,1);thumbnails[3511907]=new thumbnail(3511907,"95693","Mark Ellis. GpA Subaru Impreza","Ellis Subaru low webs_thumb.jpg",130,67,1);thumbnails[3511912]=new thumbnail(3511912,"95693","Sebastian Loeb. Citroen C4","Loeb2008 low web_thumb.jpg",130,86,1);thumbnails[3511915]=new thumbnail(3511915,"95693","Kris Meeke. Peugeot 207 Super 2000","Meeke 207 low webs_thumb.jpg",130,78,1);thumbnails[3511917]=new thumbnail(3511917,"95693","Malcom Wilson. Mitchelin Pilot Escort Cosworth","Michelin Pilot Escort low webs_thumb.jpg",130,64,1);thumbnails[3511918]=new thumbnail(3511918,"95693","Ari Vatanen. Rothmans Ford Escort","Vatanen Rothmans Escortlow webs_thumb.jpg",130,73,1);thumbnails[5471682]=new thumbnail(5471682,"95693","Audi A3 - Kynnaston","Audi_S3_Kynnaston_web1_thumb.jpg",130,63,1);thumbnails[5471732]=new thumbnail(5471732,"95693","Citroen C4. Petter Solberg","Citroen_C4_Solberg_web_thumb.jpg",130,56,1);thumbnails[5471751]=new thumbnail(5471751,"95693","Fiat 131 Arbarth. Michelle Mouton","Fiat_131_Arbarth_web_thumb.jpg",130,64,1);thumbnails[5471759]=new thumbnail(5471759,"95693","Mini Cooper. Monte Carlo","Mini_Cooper_web_thumb.jpg",130,71,1);thumbnails[5471763]=new thumbnail(5471763,"95693","Skoda Fabia S2000","Skoda_S2000_Fabia_web_thumb.jpg",130,69,1);thumbnails[5471774]=new thumbnail(5471774,"95693","Subaru Legacy. Colin Mcrae","Subaru_Legacy_web_thumb.jpg",130,66,1);thumbnails[1589291]=new thumbnail(1589291,"95693",'Selected any three images from the website to be printed in a 12"x8" mount',"Three in a frame_thumb.jpg",130,160,1);var galleries=new Object();galleries[315986]=new gallery(315986,"5574553,5570667","Rallycards Rally Cars","gallery",[5570667,5570682,5570711,5570776,5570785,5570810,5570832,5574553]);galleries[95688]=new gallery(95688,"1662075,1519113,1387287,1370171,1370159,1370153","Spectator Pack","gallery",[1370153,1370159,1370171,1387287,1519113,1662075]);galleries[95686]=new gallery(95686,"1589229,1370158","Classic Pack","gallery",[1370147,1370156,1370158,1519124,1589229,1662076]);galleries[95694]=new gallery(95694,"1519108","Drivers Pack","gallery",[1370161,1370163,1370186,1519108,1519116,1662077]);galleries[95693]=new gallery(95693,"5471774,3511918,3139460,3139453,1613360,1370148","Gallery","gallery",[1370148,1370168,1370174,1370180,1387291,1519089,1519093,1519096,1519104,1519120,1519126,1519127,1519129,1519135,1613360,1636074,1666367,1745709,1745712,1786645,3139453,3139457,3139460,3139463,3139468,3139472,3139475,3139482,3139488,3511907,3511912,3511915,3511917,3511918,5471682,5471732,5471751,5471759,5471763,5471774,1589291]);var imageSets=new Object();imageSets[1]="5471763,5471732,5471682,3511917,3139460,1636074";imageSets[2]="5574553,5570667,5471774,3511918,3139460,3139453,1613360,1589229,1519108,1370158,1370148";imageSets[3]="5574553,5570832,5570810,5570785,5570776,5570711,5570682,5570667,5471774,5471763,5471759,5471751,5471732,5471682,3511918,3511917,3511915,3511912,3511907,3139488,3139482,3139475,3139472,3139468,3139463,3139460,3139457,3139453,1786645,1745712,1745709,1666367,1662077,1662076,1662075,1636074,1613360,1589291,1589229,1519135,1519129,1519127,1519126,1519124,1519120,1519116,1519113,1519108,1519104,1519096";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/rallycards/images";break}switch(a){case 1:b="http://www1.clikpic.com/rallycards/images";break}switch(a){case 2:b="http://admin.clikpic.com/rallycards/images";break}switch(a){case 24:b="http://tpc15/clikpic/rallycards/images";break}switch(a){case 4:b="http://www.clikchurch.com/rallycards/images";break}switch(a){case 5:b="http://www2.clikpic.com/rallycards/images";break}switch(a){case 22:b="http://tpc5/clikpic/rallycards/images";break}switch(a){case 23:b="http://tpc10/clikpic/rallycards/images";break}switch(a){case 25:b="http://tpc16/clikpic/rallycards/images";break}switch(a){case 15:b="http://www3.clikpic.com/rallycards/images";break}switch(a){case 18:b="http://www4.clikpic.com/rallycards/images";break}switch(a){case 19:b="http://www5.clikpic.com/rallycards/images";break}switch(a){case 31:b="http://www7.clikpic.com/rallycards/images";break}switch(a){case 32:b="http://admin2.clikpic.com/rallycards/images";break}switch(a){case 33:b="http://www8.clikpic.com/rallycards/images";break}switch(a){case 34:b="http://www9.clikpic.com/rallycards/images";break}switch(a){case 35:b="http://admin3.clikpic.com/rallycards/images";break}switch(a){case 37:b="http://admin4.clikpic.com/rallycards/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="rallycards.co.uk: "+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({centre:true});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 pack of Rallycards online or order mounted print</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="garethlay@yahoo.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="garethlay@yahoo.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(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}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+'")'})}}};