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[768573]=new thumbnail(768573,"86694","","OllieItalianColours1_thumb.jpg",130,86,18);thumbnails[774545]=new thumbnail(774545,"86694","","olliecadwell06pk_thumb.jpg",130,87,18);thumbnails[1209287]=new thumbnail(1209287,"86694","","Ollie 4_thumb.jpg",130,86,18);thumbnails[1209338]=new thumbnail(1209338,"86694","","Ollie & Tom 1a_thumb.jpg",130,86,18);thumbnails[1209381]=new thumbnail(1209381,"86694","","Ollie @ BH 07 copy_thumb.jpg",130,183,18);thumbnails[1209409]=new thumbnail(1209409,"86694","","BSB BH06 R1 029 copy_thumb.jpg",130,195,18);thumbnails[1209444]=new thumbnail(1209444,"86694","","Ollie & Tom pitlane Thruxton 07 023 copy_thumb.jpg",130,87,18);thumbnails[1209448]=new thumbnail(1209448,"86694","","Ollie Bridewell 010 copy_thumb.jpg",130,86,18);thumbnails[1209453]=new thumbnail(1209453,"86694","","Ollie Bridewell 026 copy_thumb.jpg",130,86,18);thumbnails[1213672]=new thumbnail(1213672,"86694","","Ollie a_thumb.jpg",130,87,18);thumbnails[1213683]=new thumbnail(1213683,"86694","","Ollie b_thumb.jpg",130,195,18);thumbnails[1213690]=new thumbnail(1213690,"86694","","Ollie c_thumb.jpg",130,87,18);thumbnails[1213696]=new thumbnail(1213696,"86694","","Ollie d_thumb.jpg",130,87,18);thumbnails[1485191]=new thumbnail(1485191,"86694","","mini 1a_thumb.jpg",130,196,18);thumbnails[1485203]=new thumbnail(1485203,"86694","","Tom Mini 2_thumb.jpg",130,86,18);thumbnails[1485207]=new thumbnail(1485207,"86694","","Tom Mini 3_thumb.jpg",130,86,18);thumbnails[1485216]=new thumbnail(1485216,"86694","","Tom Mini 41_thumb.jpg",130,196,18);thumbnails[1485220]=new thumbnail(1485220,"86694","","Tom Mini 5_thumb.jpg",130,86,18);thumbnails[1485222]=new thumbnail(1485222,"86694","","Tom Mini copy_thumb.jpg",130,86,18);thumbnails[1551819]=new thumbnail(1551819,"86694","","Ollie at Castle Combe_thumb.jpg",130,87,18);thumbnails[3760804]=new thumbnail(3760804,"229420","METZELER 1000cc SUPERSTOCK ROUND ONE","Richard_Cooper_copy_thumb.jpg",130,86,18);thumbnails[3761109]=new thumbnail(3761109,"229420","","David_Hallett_thumb.jpg",130,86,18);thumbnails[3761110]=new thumbnail(3761110,"229420","","Leon_Hunt_thumb.jpg",130,86,18);thumbnails[3969629]=new thumbnail(3969629,"229420","METZELER 1000cc SUPERSTOCK ROUND THREE","Team_Co-rdit_thumb.jpg",130,86,18);thumbnails[4108853]=new thumbnail(4108853,"223214","McGUINNESS TAKES LAP RECORD","John_Mc_Guinness_09_T_T_thumb.jpg",130,196,18);thumbnails[4108875]=new thumbnail(4108875,"223214","PLATER WINS SENIOR T T","Steve_Plater_TT_09_798_thumb.jpg",130,86,18);thumbnails[4108877]=new thumbnail(4108877,"223214","JENNY SETS LAP RECORD","Jenny_TT_09_thumb.jpg",130,173,18);thumbnails[4254788]=new thumbnail(4254788,"229420","","Bruce_Wilson_1042_copy_thumb.jpg",130,86,18);thumbnails[4254789]=new thumbnail(4254789,"229420","","Richard_Cooper_kh_629_copy_thumb.jpg",130,86,18);thumbnails[4254792]=new thumbnail(4254792,"229420","","Richard_Cooper_kh_983_thumb.jpg",130,196,18);thumbnails[4387509]=new thumbnail(4387509,"229420","SUPER COOPER WINS AT MALLORY","Richard_Cooper_72_copy_thumb.jpg",130,86,18);thumbnails[4387511]=new thumbnail(4387511,"229420","COOPER ON PODIUM","Richard_Cooper_788_copy_thumb.jpg",130,196,18);thumbnails[4387516]=new thumbnail(4387516,"229420","","Richard_Cooper_651_copy_thumb.jpg",130,196,18);thumbnails[4742533]=new thumbnail(4742533,"229420","COOPER TOP TEN AT CROFT","Rich_thumb.jpg",130,86,18);thumbnails[4742554]=new thumbnail(4742554,"229420","","Sam_thumb.jpg",130,209,18);thumbnails[4742560]=new thumbnail(4742560,"229420","","Rich_2_thumb.jpg",130,192,18);thumbnails[4762527]=new thumbnail(4762527,"229420","Philip Bevan  N G Road Racing<br>\r\n2009 Phoenix Open Champion<br>\r\n2009 Powerbike Champion","NG_Champion_Phil_Bevan_thumb.jpg",130,86,18);thumbnails[4935600]=new thumbnail(4935600,"229420","CO-ORDIT RACING THIRD TITLE","Sam_Championship_trophy_copy_thumb.jpg",130,101,18);thumbnails[4935725]=new thumbnail(4935725,"229420","SHOWROOM TO PODIUM","Josh_day_30_copy_thumb.jpg",130,86,18);thumbnails[5571959]=new thumbnail(5571959,"316061","CHECT charity logo that will be displayed by National Superstock Competitor Victor Cox during the 2010 British Superbike Season.","Charity_logo_thumb.jpg",130,57,18);thumbnails[1091010]=new thumbnail(1091010,"80507","","John McGuinness_thumb.jpg",130,196,18);thumbnails[1091012]=new thumbnail(1091012,"80507","","Steve Plater_thumb.jpg",130,196,18);thumbnails[1472971]=new thumbnail(1472971,"80507","","Joey Dunlop_thumb.jpg",130,196,18);thumbnails[1472973]=new thumbnail(1472973,"80507","","John Mcguiness 209_thumb.jpg",130,86,18);thumbnails[1472974]=new thumbnail(1472974,"80507","","John Mcguiness TT 07_thumb.jpg",130,203,18);thumbnails[774610]=new thumbnail(774610,"58963","","B S B Snetterton 06 R7 159 copy1_thumb.jpg",130,86,18);thumbnails[914571]=new thumbnail(914571,"58963","","Tommy Hill 147_thumb.jpg",130,86,18);thumbnails[1430182]=new thumbnail(1430182,"58963","","Chris Walker2_thumb.jpg",130,86,18);thumbnails[1430190]=new thumbnail(1430190,"58963","","McGuiness_thumb.jpg",130,86,18);thumbnails[2101963]=new thumbnail(2101963,"58963","","V Cox 394 copy_thumb.jpg",130,86,18);thumbnails[2826847]=new thumbnail(2826847,"58963","","Croft sb1_thumb.jpg",130,86,18);thumbnails[3806286]=new thumbnail(3806286,"58963","2009 BRITISH SUPERBIKE RACE DATES","Camier_09_88_bh_thumb.jpg",130,86,18);thumbnails[3890900]=new thumbnail(3890900,"58963","COOPER'S FIRST 600cc WIN","Daniel_Cooper_op_479_thumb.jpg",130,196,18);thumbnails[4143519]=new thumbnail(4143519,"58963","SUPERBIKE PODIUM FOR BRIDEWELL","Tom_Bridewell_353_copy_thumb.jpg",130,196,18);thumbnails[4742691]=new thumbnail(4742691,"58963","PLATER WINS AT CROFT","Steve_thumb.jpg",130,196,18);thumbnails[4813093]=new thumbnail(4813093,"58963"," WESTY ON RECORD PACE","Westy_thumb.jpg",130,88,18);thumbnails[5255271]=new thumbnail(5255271,"58963","BRIDEWELL JOINS CHAMPIONSHIP WINNERS","Tom_Bridewell_367_copy_thumb.jpg",130,165,18);thumbnails[768533]=new thumbnail(768533,"59464","","WSBMagnycours3331_thumb.jpg",130,86,18);thumbnails[768538]=new thumbnail(768538,"59464","","WSBBrandsHatch357_thumb.jpg",130,196,18);thumbnails[768580]=new thumbnail(768580,"59464","","WSBMagnycours3782_thumb.jpg",130,86,18);thumbnails[768605]=new thumbnail(768605,"59464","","James Toseland BH 06 406 copy_thumb.jpg",130,86,18);thumbnails[768639]=new thumbnail(768639,"59464","","ToselandatBrands_thumb.jpg",130,86,18);thumbnails[768663]=new thumbnail(768663,"59464","","WSBMagnyCours Cwalker_thumb.jpg",130,86,18);thumbnails[774603]=new thumbnail(774603,"59464","","Brands Hatch 06 5382_thumb.jpg",130,196,18);thumbnails[774637]=new thumbnail(774637,"59464","","Worldsuperbike Magnycours118_thumb.jpg",130,86,18);thumbnails[774642]=new thumbnail(774642,"59464","","WSBBrandsHatch048_thumb.jpg",130,86,18);thumbnails[780835]=new thumbnail(780835,"59464","","James Toseland Pit_thumb.jpg",130,196,18);thumbnails[780837]=new thumbnail(780837,"59464","","Kagi@Brands06_thumb.jpg",130,196,18);thumbnails[780840]=new thumbnail(780840,"59464","","ToselandBH06_thumb.jpg",130,196,18);thumbnails[880719]=new thumbnail(880719,"59464","","Haga at DP07 2732_thumb.jpg",130,168,18);thumbnails[880722]=new thumbnail(880722,"59464","","Biaggi 417_thumb.jpg",130,86,18);thumbnails[880723]=new thumbnail(880723,"59464","","Tosedland 415_thumb.jpg",130,86,18);thumbnails[2754147]=new thumbnail(2754147,"59464","","Corser 12_thumb.jpg",130,86,18);thumbnails[2754153]=new thumbnail(2754153,"59464","","cruchlow 1_thumb.jpg",130,86,18);thumbnails[2754157]=new thumbnail(2754157,"59464","","Sykes 1_thumb.jpg",130,86,18);thumbnails[768813]=new thumbnail(768813,"59478","","Castlecombe3_thumb.jpg",130,86,18);thumbnails[768819]=new thumbnail(768819,"59478","","Worldsidecar1_thumb.jpg",130,196,18);thumbnails[768836]=new thumbnail(768836,"59478","","Airbourne@Thruxton_thumb.jpg",130,86,18);thumbnails[783135]=new thumbnail(783135,"60749","Colin Edwards","Colin Edwards_thumb.jpg",130,86,18);thumbnails[783138]=new thumbnail(783138,"60749","Daniel Cooper","Daniel Cooper_thumb.jpg",130,86,18);thumbnails[783140]=new thumbnail(783140,"60749","Gregorio Lavilla","Gregorio Lavilla_thumb.jpg",130,196,18);thumbnails[783144]=new thumbnail(783144,"60749","James Toseland","James Toseland Bh 05 copy_thumb.jpg",130,196,18);thumbnails[783147]=new thumbnail(783147,"60749","John Reynolds","John Reynolds_thumb.jpg",130,86,18);thumbnails[783148]=new thumbnail(783148,"60749","Karl Harris","Karl Harris_thumb.jpg",130,86,18);thumbnails[784121]=new thumbnail(784121,"60749","Colin Edwards","Edwardsmgpdp_thumb.jpg",130,86,18);thumbnails[784123]=new thumbnail(784123,"60749","Nicky Haydon","Haydonmgpdp_thumb.jpg",130,86,18);thumbnails[784126]=new thumbnail(784126,"60749","Valentino Rossi","Rossimgpdp_thumb.jpg",130,86,18);thumbnails[1430189]=new thumbnail(1430189,"60749","","kio_thumb.jpg",130,86,18);thumbnails[2048962]=new thumbnail(2048962,"60749","","shakey 2_thumb.jpg",130,196,18);thumbnails[2101960]=new thumbnail(2101960,"60749","","Larry Th 55 copy_thumb.jpg",130,85,18);thumbnails[2754140]=new thumbnail(2754140,"60749","","Bayliss 1_thumb.jpg",130,86,18);thumbnails[2754142]=new thumbnail(2754142,"60749","","Bayliss 2_thumb.jpg",130,86,18);thumbnails[2651500]=new thumbnail(2651500,"167939","1st Tommy Bridewell 2nd Victor Cox 3rd Barry Burrell","Tommy 1st1_thumb.jpg",130,196,18);thumbnails[2651501]=new thumbnail(2651501,"167939","","Tommy 2_thumb.jpg",130,86,18);thumbnails[2651502]=new thumbnail(2651502,"167939","","Tommy 3_thumb.jpg",130,196,18);thumbnails[2754162]=new thumbnail(2754162,"167939","","TB 1a_thumb.jpg",130,86,18);thumbnails[2754164]=new thumbnail(2754164,"167939","","TB2_thumb.jpg",130,86,18);thumbnails[2754166]=new thumbnail(2754166,"167939","","Tb3_thumb.jpg",130,192,18);thumbnails[2754223]=new thumbnail(2754223,"167939","","TB at Cadwell 1_thumb.jpg",130,86,18);thumbnails[2754227]=new thumbnail(2754227,"167939","","TB at cadwell2_thumb.jpg",130,86,18);thumbnails[2754243]=new thumbnail(2754243,"167939","","TB at Cadwell3_thumb.jpg",130,86,18);thumbnails[4254708]=new thumbnail(4254708,"167939","","Tom_Bridewell_403_copy_thumb.jpg",130,86,18);thumbnails[4254714]=new thumbnail(4254714,"167939","","Tom__Snett_353_thumb.jpg",130,196,18);thumbnails[4254786]=new thumbnail(4254786,"167939","","Tom_496_thumb.jpg",130,86,18);thumbnails[4387542]=new thumbnail(4387542,"167939","BRIDEWELL ON MALLORY PODUIM","Tom_Bridewell_47_copy_thumb.jpg",130,86,18);thumbnails[4387547]=new thumbnail(4387547,"167939","","Tom_Bridewell_290_copy_thumb.jpg",130,86,18);thumbnails[4387551]=new thumbnail(4387551,"167939","","Tom_Bridewell_563_copy_thumb.jpg",130,86,18);thumbnails[3977481]=new thumbnail(3977481,"167913","","Josh_Day_thumb.jpg",130,86,18);thumbnails[3977486]=new thumbnail(3977486,"167913","","Tom_Young_thumb.jpg",130,86,18);thumbnails[3977514]=new thumbnail(3977514,"167913","","Leon_Hunt1_thumb.jpg",130,86,18);thumbnails[3977545]=new thumbnail(3977545,"167913","","James_oulton_thumb.jpg",130,196,18);thumbnails[4143591]=new thumbnail(4143591,"167913","","Met_445_snt_thumb.jpg",130,86,18);thumbnails[4742309]=new thumbnail(4742309,"222906","","Victor_thumb.jpg",130,196,18);thumbnails[4742326]=new thumbnail(4742326,"222906","","Victor_2_thumb.jpg",130,81,18);thumbnails[4761993]=new thumbnail(4761993,"222906","","Victor_Cox_390_copy_thumb.jpg",130,86,18);thumbnails[4762076]=new thumbnail(4762076,"222906","VICTOR'S BEST SO FAR","Victor_Cox_203_copy_thumb.jpg",130,99,18);thumbnails[3860998]=new thumbnail(3860998,"234843","DOUBLE RECORD FOR FREDDIE","Freddie_250_thumb.jpg",130,86,18);thumbnails[3860994]=new thumbnail(3860994,"234843","","Freddie_358_thumb.jpg",130,196,18);thumbnails[3860996]=new thumbnail(3860996,"234843","","Freddie_0020_thumb.jpg",130,86,18);thumbnails[3860997]=new thumbnail(3860997,"234843","","Freddie_241_thumb.jpg",130,86,18);var galleries=new Object();galleries[229420]=new gallery(229420,"4935725,4935600,4762527,4742560,4742554,4742533,4387516,4387511,4387509,4254792","Co-ordit Racing","section280510",[3760804,3761109,3761110,3969629,4254788,4254789,4254792,4387509,4387511,4387516,4742533,4742554,4742560,4762527,4935600,4935725]);galleries[223214]=new gallery(223214,"4108877,4108875,4108853","Isle of Man T T 2009","section273445",[4108853,4108875,4108877]);galleries[316061]=new gallery(316061,"5571959","Ollie's Ride Down South","section378789",[5571959]);galleries[86694]=new gallery(86694,"1551819,1485222,1485220,1485216,1485207,1485203,1485191,1213696,1213690,1213683","Tribute to Ollie Bridewell","section86338",[768573,774545,1209287,1209338,1209381,1209409,1209444,1209448,1209453,1213672,1213683,1213690,1213696,1485191,1485203,1485207,1485216,1485220,1485222,1551819]);galleries[80507]=new gallery(80507,"1472974,1472973,1472971,1091012,1091010","Isle of Man T T","section86592",[1091010,1091012,1472971,1472973,1472974]);galleries[58963]=new gallery(58963,"5255271,4813093,4742691,4143519,3890900,3806286,2826847,2101963,1430190,1430182","British Superbike","section86338",[774610,914571,1430182,1430190,2101963,2826847,3806286,3890900,4143519,4742691,4813093,5255271]);galleries[59464]=new gallery(59464,"2754157,2754153,2754147,880723,880722,880719,780840,780837,780835,774642","World Superbike","section86340",[768533,768538,768580,768605,768639,768663,774603,774637,774642,780835,780837,780840,880719,880722,880723,2754147,2754153,2754157]);galleries[59478]=new gallery(59478,"768836,768819,768813","Various","section86592",[768813,768819,768836]);galleries[60749]=new gallery(60749,"2754142,2754140,2101960,2048962,1430189,784126,784123,784121,783148,783147","champions","section88439",[783135,783138,783140,783144,783147,783148,784121,784123,784126,1430189,2048962,2101960,2754140,2754142]);galleries[167939]=new gallery(167939,"4387551,4387547,4387542,4254786,4254714,4254708,2754243,2754227,2754223,2754166","Wayside Racing","section166096",[2651500,2651501,2651502,2754162,2754164,2754166,2754223,2754227,2754243,4254708,4254714,4254786,4387542,4387547,4387551]);galleries[167913]=new gallery(167913,"4143591,3977545,3977514,3977486,3977481","Metzeler Superstock 600","section210768",[3977481,3977486,3977514,3977545,4143591]);galleries[222905]=new gallery(222905,"","profile","section266067",[]);galleries[222906]=new gallery(222906,"4762076,4761993,4742326,4742309","Victor Cox Racing","section86338",[4742309,4742326,4761993,4762076]);galleries[234843]=new gallery(234843,"3860998,3860997,3860996,3860994","Chippenham Motorcycles","section286584",[3860998,3860994,3860996,3860997]);var imageSets=new Object();imageSets[1]="5571959,5255271,4935725,4935600,4813093,4762527,4762076,4761993,4742691,4742560,4742554,4742533,4742326,4742309,4387551,4387547,4387542,4387516,4387511,4387509,4254792,4254789,4254788,4254786,4254714,4254708,4143591,4143519,4108877,4108875,4108853,3977545,3977514,3977486,3977481,3969629,3890900,3860998,3860997,3860996,3860994,3806286,3761110,3761109,3760804,2826847,2754243,2754227,2754223,2754166";imageSets[3]="5571959,5255271,4935725,4935600,4813093,4762527,4762076,4761993,4742691,4742560,4742554,4742533,4742326,4742309,4387551,4387547,4387542,4387516,4387511,4387509,4254792,4254789,4254788,4254786,4254714,4254708,4143591,4143519,4108877,4108875,4108853,3977545,3977514,3977486,3977481,3969629,3890900,3860998,3860997,3860996,3860994,3806286,3761110,3761109,3760804,2826847,2754243,2754227,2754223,2754166";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/Yamaha/images";break}switch(a){case 1:b="http://www1.clikpic.com/Yamaha/images";break}switch(a){case 2:b="http://admin.clikpic.com/Yamaha/images";break}switch(a){case 24:b="http://tpc15/clikpic/Yamaha/images";break}switch(a){case 4:b="http://www.clikchurch.com/Yamaha/images";break}switch(a){case 5:b="http://www2.clikpic.com/Yamaha/images";break}switch(a){case 22:b="http://tpc5/clikpic/Yamaha/images";break}switch(a){case 23:b="http://tpc10/clikpic/Yamaha/images";break}switch(a){case 25:b="http://tpc16/clikpic/Yamaha/images";break}switch(a){case 15:b="http://www3.clikpic.com/Yamaha/images";break}switch(a){case 18:b="http://www4.clikpic.com/Yamaha/images";break}switch(a){case 19:b="http://www5.clikpic.com/Yamaha/images";break}switch(a){case 31:b="http://www7.clikpic.com/Yamaha/images";break}switch(a){case 32:b="http://admin2.clikpic.com/Yamaha/images";break}switch(a){case 33:b="http://www8.clikpic.com/Yamaha/images";break}switch(a){case 34:b="http://www9.clikpic.com/Yamaha/images";break}switch(a){case 35:b="http://admin3.clikpic.com/Yamaha/images";break}switch(a){case 37:b="http://admin4.clikpic.com/Yamaha/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("section210788"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section210788.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("section210788"!=""){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="P K PhotoMedia: "+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+'")'})}}};