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[5125234]=new thumbnail(5125234,"134179","Aston Martin LMP1 Le Mans 2009","lmp2009_restaurant_net_thumb.jpg",130,94,18);thumbnails[5125285]=new thumbnail(5125285,"134179","Last check before the ball","last_check_net_thumb.jpg",130,188,18);thumbnails[4807349]=new thumbnail(4807349,"134179","LM1960 Corvette at Arnage corner","lm60_no3_net_thumb.jpg",130,84,18);thumbnails[4765828]=new thumbnail(4765828,"134179","le Pilier Vert, Vieux Mans, 2009","pilier_vert_net_thumb.jpg",130,103,18);thumbnails[4601493]=new thumbnail(4601493,"134179","parcé moulin sarthe","parce_moulin_net_thumb.jpg",130,201,18);thumbnails[4320299]=new thumbnail(4320299,"134179","aston martin lmp1 le mans 2009","lmp1_2009_net_thumb.jpg",130,88,18);thumbnails[4304677]=new thumbnail(4304677,"134179","le mans 2009 aston martin v8 gt2","003net_thumb.jpg",130,78,18);thumbnails[4203577]=new thumbnail(4203577,"69234","gt40 le mans 1969","GT40_1969_net_thumb.jpg",130,77,18);thumbnails[4203584]=new thumbnail(4203584,"69238","st jean de la motte watercolour aquarelle","stjean_motte_09_net_thumb.jpg",130,179,18);thumbnails[4204041]=new thumbnail(4204041,"69234","le mans 2009","lucalphand_09_net_thumb.jpg",130,83,18);thumbnails[3729322]=new thumbnail(3729322,"69234","sauber mercedes le mans 1989","mercedes_89_no63_net_thumb.jpg",130,87,18);thumbnails[3499144]=new thumbnail(3499144,"69238","combwich somerset","combwich small_thumb.jpg",130,91,18);thumbnails[3349064]=new thumbnail(3349064,"69234","mazda rouge","mazda 3 red net_thumb.jpg",130,95,18);thumbnails[3153874]=new thumbnail(3153874,"69238","eglise luche pringe","luche church_thumb.jpg",130,174,18);thumbnails[3053241]=new thumbnail(3053241,"84294","Phil Hill LM1958","Phil Hill LM58 net1_thumb.jpg",130,87,18);thumbnails[3053253]=new thumbnail(3053253,"84294","917K LM1970 Pedro Rodriguez","917K LM1970net_thumb.jpg",130,88,18);thumbnails[3053260]=new thumbnail(3053260,"84294",'Bentley 1927 4.5litre "Le Mans"',"bentley 4,5LM1927net1_thumb.jpg",130,94,18);thumbnails[3053543]=new thumbnail(3053543,"84294","250GTO LM1962","250gto final net_thumb.jpg",130,174,18);thumbnails[2945651]=new thumbnail(2945651,"69238","loir luche pringe aquarelle","merve luche net_thumb.jpg",130,91,18);thumbnails[2692054]=new thumbnail(2692054,"69234","Bentley 1927 4,5litre 'Le Mans'","bentley 4,5LM1927net_thumb.jpg",130,94,18);thumbnails[2531293]=new thumbnail(2531293,"69239","Jennifer portrait","jennifer2net_thumb.jpg",130,195,18);thumbnails[2522147]=new thumbnail(2522147,"69234","dbr9 lm2008 007","dbr9 2008 net_thumb.jpg",130,205,18);thumbnails[2509335]=new thumbnail(2509335,"69234","Phil Hill Ferrari TR250 1958 winner Le Mans","Phil Hill LM58 net_thumb.jpg",130,87,18);thumbnails[2415852]=new thumbnail(2415852,"69239","dreamz faut pas rêver","dreamz_thumb.jpg",130,186,18);thumbnails[907446]=new thumbnail(907446,"69234","Aston Martin DBR9, Le Mans 2006","dbr9_thumb.jpg",130,89,18);thumbnails[907478]=new thumbnail(907478,"69237","Chateau_de_Chambord","chambord_thumb.jpg",130,102,18);thumbnails[907487]=new thumbnail(907487,"69237","Vieux Mans, Le Cour","cour_le_mans_thumb.jpg",130,197,18);thumbnails[907488]=new thumbnail(907488,"69238","Devon Estuary at sunrise","devon_sunrise_thumb.jpg",130,86,18);thumbnails[907491]=new thumbnail(907491,"69234","Indy 512S","indy_512s_thumb.jpg",130,86,18);thumbnails[907501]=new thumbnail(907501,"69238","La Croix, Ligron","lacroix_thumb.jpg",130,87,18);thumbnails[907505]=new thumbnail(907505,"69239","lingerie blanche","lingerie_thumb.jpg",130,236,18);thumbnails[907508]=new thumbnail(907508,"69239","le visage","michelle_thumb.jpg",130,97,18);thumbnails[907512]=new thumbnail(907512,"69237","Le moulin, La Fleche","moulin_thumb.jpg",130,190,18);thumbnails[907518]=new thumbnail(907518,"69234","Pescarolo Judd, Le Mans 2006","pescarolo_thumb.jpg",130,76,18);thumbnails[907520]=new thumbnail(907520,"69237","Le Pilier Rouge, Vieux Mans","pilier_rouge_thumb.jpg",130,174,18);thumbnails[907538]=new thumbnail(907538,"69236","poppies v2 2006","poppies_thumb.jpg",130,236,18);thumbnails[907539]=new thumbnail(907539,"69237","la Pellerie, la Porte","porte_thumb.jpg",130,93,18);thumbnails[907542]=new thumbnail(907542,"69239","Rear view","rear_view_thumb.jpg",130,203,18);thumbnails[907545]=new thumbnail(907545,"69238","Le printemps, Ligron","spring_thumb.jpg",130,91,18);thumbnails[907548]=new thumbnail(907548,"69238","the fisherman, St Jean de la Motte","st_jean_reflets_thumb.jpg",130,96,18);thumbnails[907550]=new thumbnail(907550,"69238","sous bois","st_jean_trees_thumb.jpg",130,89,18);thumbnails[907554]=new thumbnail(907554,"69234","Tom 7, Audi 5","tom_7th_win_thumb.jpg",130,57,18);thumbnails[907555]=new thumbnail(907555,"69237","Vennevelles","vennevelles_thumb.jpg",130,168,18);thumbnails[907562]=new thumbnail(907562,"69236","azalees blanches","white_azalea_thumb.jpg",130,94,18);thumbnails[907568]=new thumbnail(907568,"69236","The yellow king","yellow_king_thumb.jpg",130,87,18);thumbnails[908958]=new thumbnail(908958,"69236","purple granny bonnet, ancolie","ancolie_thumb.jpg",130,156,18);thumbnails[908959]=new thumbnail(908959,"69239","the purple dress","violin_thumb.jpg",130,193,18);thumbnails[908960]=new thumbnail(908960,"69234","aston martin vanquish, 2004","aston_martin_vanquish_thumb.jpg",130,90,18);thumbnails[908969]=new thumbnail(908969,"69237","wells cathedral","wells cathedral_thumb.jpg",130,86,18);thumbnails[908972]=new thumbnail(908972,"69238","st jean de la motte concours 2005","st_jean_motte_village_thumb.jpg",130,85,18);thumbnails[970605]=new thumbnail(970605,"69234","Ferrari P4, LM1967, ","p4 fin_thumb.jpg",130,91,18);thumbnails[1101585]=new thumbnail(1101585,"69234","rml lola 2006","rml net_thumb.jpg",130,77,18);thumbnails[1166199]=new thumbnail(1166199,"84294","DBR9 ","009print_thumb.jpg",130,69,18);thumbnails[1166224]=new thumbnail(1166224,"84294","P4 Ferrari LM1967","p4 fin1_thumb.jpg",130,91,18);thumbnails[1168509]=new thumbnail(1168509,"84294","pescarolo judd lm2006","pescarolo1_thumb.jpg",130,76,18);thumbnails[1237071]=new thumbnail(1237071,"69238","La Sarthe  at Parcé","sarthe at parce_thumb.jpg",130,88,18);thumbnails[1431780]=new thumbnail(1431780,"69234","Stirling Moss, Aston Martin DBR1, Le Mans","moss 07 dbr1 net_thumb.jpg",130,84,18);thumbnails[1695748]=new thumbnail(1695748,"69238","la galerie à La Pellerie enneigé Fevrier 2007 ","snow gallery 07_thumb.jpg",130,88,18);thumbnails[1695798]=new thumbnail(1695798,"69237","Old Le Mans, le vieux mans","vieux mans 07net_thumb.jpg",130,179,18);thumbnails[2000638]=new thumbnail(2000638,"69236","White roses at Parcé","white roses_thumb.jpg",130,181,18);thumbnails[2002850]=new thumbnail(2002850,"69234","917 Pedro LM1970","917k lm1970 net_thumb.jpg",130,88,18);thumbnails[2008886]=new thumbnail(2008886,"69239","bas bleus blue stockings","bas bleus_thumb.jpg",130,239,18);thumbnails[2008901]=new thumbnail(2008901,"69236","les groseilles rouges, redcurrants","redcurrants_thumb.jpg",130,184,18);thumbnails[2030435]=new thumbnail(2030435,"69239","Chloé avec son portrait","Chloe_thumb.jpg",130,172,18);thumbnails[2030440]=new thumbnail(2030440,"69234","250GTO in the Esses 1962","250gto web_thumb.jpg",130,174,18);thumbnails[2030479]=new thumbnail(2030479,"69234","Seb Bourdais at the office","bordais_thumb.jpg",130,101,18);var galleries=new Object();galleries[69237]=new gallery(69237,"907478","Buildings/Châteaux","gallery",[907478,907487,907512,907520,907539,907555,908969,1695798]);galleries[69234]=new gallery(69234,"907491","Cars/Voitures","gallery",[4203577,4204041,3729322,3349064,2692054,2522147,2509335,907446,907491,907518,907554,908960,970605,1101585,1431780,2002850,2030440,2030479]);galleries[69236]=new gallery(69236,"907568","Flowers/Fleurs","gallery",[907538,907562,907568,908958,2000638,2008901]);galleries[69239]=new gallery(69239,"2415852,907508","Girls/les Filles","gallery",[2531293,2415852,907505,907508,907542,908959,2008886,2030435]);galleries[69238]=new gallery(69238,"907545","Landscapes/Paysages","gallery",[4203584,3499144,3153874,2945651,907488,907501,907545,907548,907550,908972,1237071,1695748]);galleries[134179]=new gallery(134179,"5125285,4765828","New Work","gallery",[5125234,5125285,4807349,4765828,4601493,4320299,4304677]);galleries[84294]=new gallery(84294,"1166199","Prints/reproductions","gallery",[3053241,3053253,3053260,3053543,1166199,1166224,1168509]);var imageSets=new Object();imageSets[1]="5125234,4807349,4304677,4204041";imageSets[2]="5125285,4765828,2415852,1166199,907568,907545,907508,907491,907478";imageSets[3]="5125285,5125234,4807349,4765828,4601493,4320299,4304677,4204041,4203584,4203577,3729322,3499144,3349064,3153874,3053543,3053260,3053253,3053241,2945651,2692054,2531293,2522147,2509335,2415852,2030479,2030440,2030435,2008901,2008886,2002850,2000638,1695798,1695748,1431780,1237071,1168509,1166224,1166199,1101585,970605,908972,908969,908960,908959,908958,907568,907562,907555,907554,907550";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/raytoombs/images";break}switch(a){case 1:b="http://www1.clikpic.com/raytoombs/images";break}switch(a){case 2:b="http://admin.clikpic.com/raytoombs/images";break}switch(a){case 4:b="http://www.clikchurch.com/raytoombs/images";break}switch(a){case 5:b="http://www2.clikpic.com/raytoombs/images";break}switch(a){case 15:b="http://www3.clikpic.com/raytoombs/images";break}switch(a){case 21:b="http://www6.clikpic.com/raytoombs/images";break}switch(a){case 18:b="http://www4.clikpic.com/raytoombs/images";break}switch(a){case 19:b="http://www5.clikpic.com/raytoombs/images";break}switch(a){case 22:b="http://tpc5/clikpic/raytoombs/images";break}switch(a){case 23:b="http://tpc10/clikpic/raytoombs/images";break}switch(a){case 24:b="http://tpc15/clikpic/raytoombs/images";break}switch(a){case 25:b="http://tpc16/clikpic/raytoombs/images";break}switch(a){case 31:b="http://www7.clikpic.com/raytoombs/images";break}switch(a){case 32:b="http://admin2.clikpic.com/raytoombs/images";break}switch(a){case 33:b="http://www8.clikpic.com/raytoombs/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="Ray Toombs Watercolourist: "+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).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+'")'})}}};