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[1106972]=new thumbnail(1106972,"","","CRW_25032_thumb.jpg",120,90,1);thumbnails[1106975]=new thumbnail(1106975,"","","IMG_05291_thumb.jpg",120,85,1);thumbnails[1106978]=new thumbnail(1106978,"","","IMG_1107_thumb.jpg",120,180,1);thumbnails[1106980]=new thumbnail(1106980,"","","IMG_2189_thumb.jpg",120,67,1);thumbnails[1106981]=new thumbnail(1106981,"","","IMG_2191_thumb.jpg",120,80,1);thumbnails[1106991]=new thumbnail(1106991,"","","IMG_22711_thumb.jpg",120,180,1);thumbnails[1106995]=new thumbnail(1106995,"","","IMG_22821_thumb.jpg",120,187,1);thumbnails[1107004]=new thumbnail(1107004,"","","IMG_41361_thumb.jpg",120,80,1);thumbnails[1107006]=new thumbnail(1107006,"","","IMG_42321_thumb.jpg",120,147,1);thumbnails[1107020]=new thumbnail(1107020,"","","IMG_77541_thumb.jpg",120,80,1);thumbnails[1107022]=new thumbnail(1107022,"","","IMG_90951_thumb.jpg",120,180,1);thumbnails[1107024]=new thumbnail(1107024,"","","IMG_91452_thumb.jpg",120,180,1);thumbnails[1107028]=new thumbnail(1107028,"","","Property-Comp_thumb.jpg",120,87,1);thumbnails[1107751]=new thumbnail(1107751,"141192","Manchester Food Market, Arndale","IMG_0282_thumb.jpg",120,109,1);thumbnails[1107754]=new thumbnail(1107754,"141192","Northern Harvest, Pure Taste Magazine","IMG_9392_thumb.jpg",120,79,1);thumbnails[1107757]=new thumbnail(1107757,"141192","Northern Harvest, Pure Taste Magazine","IMG_9411_thumb.jpg",120,91,1);thumbnails[2122723]=new thumbnail(2122723,"141184","","IMG_7550_thumb.jpg",120,176,1);thumbnails[2122891]=new thumbnail(2122891,"141192","Studio product photography with food stylist","IMG_76331_thumb.jpg",120,85,1);thumbnails[2295845]=new thumbnail(2295845,"150414","Abersoch","IMG_1839_thumb.jpg",120,80,1);thumbnails[2446949]=new thumbnail(2446949,"141192","Chianti product shot","IMG_0200_thumb.jpg",120,180,1);thumbnails[4782203]=new thumbnail(4782203,"141192","Carrera","Carrera_5469_91_thumb.jpg",130,93,1);thumbnails[5664246]=new thumbnail(5664246,"141192","Carrera","Carrera_5657_40_thumb.jpg",130,93,1);thumbnails[6632518]=new thumbnail(6632518,"363331","Training Course","IMG_0945_C2CA8DFF-24E8-5EC4-4FF2870E735EE7EA_thumb.jpg",130,95,1);thumbnails[6656348]=new thumbnail(6656348,"363331","garycopy","garycopy_thumb.jpg",130,87,1);thumbnails[2122722]=new thumbnail(2122722,"141184","","IMG_6820_1_thumb.jpg",120,80,1);thumbnails[2295833]=new thumbnail(2295833,"150414","Prestbury, Cheshire","IMG_6106-copy_thumb.jpg",120,179,1);thumbnails[4782204]=new thumbnail(4782204,"141192","Carrera","Carrera_5657_90_Side_thumb.jpg",130,93,1);thumbnails[6490017]=new thumbnail(6490017,"357456","Vantage Point Photos Events","IMG_0510_thumb.jpg",130,87,1);thumbnails[6656349]=new thumbnail(6656349,"363331","garycopy2","garycopy2_thumb.jpg",130,182,1);thumbnails[1107003]=new thumbnail(1107003,"150414","Conwy Castle, Wales","IMG_2490_thumb.jpg",120,80,1);thumbnails[2122684]=new thumbnail(2122684,"141184","","IMG_7005_thumb.jpg",120,80,1);thumbnails[2295789]=new thumbnail(2295789,"150414","The Lake ","Private-Lake_1706_thumb.jpg",120,88,1);thumbnails[2295856]=new thumbnail(2295856,"150423","<br>\r\n","IMG_7703_thumb.jpg",120,80,1);thumbnails[4782205]=new thumbnail(4782205,"141192","Guess","Guess_1566_TO_XU983_thumb.jpg",130,93,1);thumbnails[6490018]=new thumbnail(6490018,"357456","Vantage Point Photos Events","IMG_0527_thumb.jpg",130,87,1);thumbnails[6656350]=new thumbnail(6656350,"363331","New Image","New_Image_thumb.jpg",130,182,1);thumbnails[1107021]=new thumbnail(1107021,"150414","Cat Bells, Cumbria","IMG_79161_thumb.jpg",120,69,1);thumbnails[2122685]=new thumbnail(2122685,"141184","","IMG_7013_1_thumb.jpg",120,79,1);thumbnails[2295857]=new thumbnail(2295857,"150423","<br>\r\n","IMG_7718_thumb.jpg",120,88,1);thumbnails[4782206]=new thumbnail(4782206,"141192","Kookai Sophie","Kookai_Sophie_Gun_K168_XJ591_thumb.jpg",130,93,1);thumbnails[6490019]=new thumbnail(6490019,"357456","Vantage Point Photos Events","IMG_0537_thumb.jpg",130,195,1);thumbnails[6656351]=new thumbnail(6656351,"363331"," MG 7349","_MG_7349_thumb.jpg",130,195,1);thumbnails[1107013]=new thumbnail(1107013,"150414","Cheshire Oak","IMG_71261_thumb.jpg",120,80,1);thumbnails[2122686]=new thumbnail(2122686,"141184","","IMG_7192_thumb.jpg",120,89,1);thumbnails[2295858]=new thumbnail(2295858,"150423","","IMG_7739_thumb.jpg",120,80,1);thumbnails[4782207]=new thumbnail(4782207,"141192","RayBan Wayfarer","RayBan_Wayfarer_thumb.jpg",130,93,1);thumbnails[6490020]=new thumbnail(6490020,"357456","Vantage Point Photos Events","IMG_0541_thumb.jpg",130,195,1);thumbnails[6656352]=new thumbnail(6656352,"363331"," MG 7382","_MG_7382_thumb.jpg",130,96,1);thumbnails[1106977]=new thumbnail(1106977,"150414","River Bollington, Cheshire","IMG_1062_thumb.jpg",120,80,1);thumbnails[2122687]=new thumbnail(2122687,"141184","","IMG_7201_thumb.jpg",120,80,1);thumbnails[2295859]=new thumbnail(2295859,"150423","","IMG_7741_thumb.jpg",120,174,1);thumbnails[6490023]=new thumbnail(6490023,"357456","Vantage Point Photos Events","IMG_0556_thumb.jpg",130,87,1);thumbnails[1107002]=new thumbnail(1107002,"150414","Conwy Estuary, Wales","IMG_2472_thumb.jpg",120,80,1);thumbnails[2122688]=new thumbnail(2122688,"141184","","IMG_7212_thumb.jpg",120,80,1);thumbnails[2295860]=new thumbnail(2295860,"150423","","IMG_7757_thumb.jpg",120,80,1);thumbnails[6490024]=new thumbnail(6490024,"357456","Vantage Point Photos Events","IMG_0565_thumb.jpg",130,195,1);thumbnails[2122721]=new thumbnail(2122721,"141184","","IMG_6798_1_thumb.jpg",120,180,1);thumbnails[2295792]=new thumbnail(2295792,"150414","Bus Stop","IMG_7165_thumb.jpg",120,164,1);thumbnails[2295861]=new thumbnail(2295861,"150423","","IMG_7792_thumb.jpg",120,85,1);thumbnails[2122690]=new thumbnail(2122690,"141184","","IMG_7405_thumb.jpg",120,76,1);thumbnails[2295862]=new thumbnail(2295862,"150423","","IMG_7823_thumb.jpg",120,80,1);thumbnails[2295938]=new thumbnail(2295938,"150414","Letter Box, Cheshire","Hale-B&W-6085_thumb.jpg",120,161,1);thumbnails[6490025]=new thumbnail(6490025,"357456","Vantage Point Photos Events","IMG_0573_thumb.jpg",130,87,1);thumbnails[2295788]=new thumbnail(2295788,"150414","Breakthrough, Cheshire","Breakthrough_7205_thumb.jpg",120,80,1);thumbnails[5664254]=new thumbnail(5664254,"141192","Porsche Carrera ","Porsche_Carrera_5463_40_thumb.jpg",130,182,1);thumbnails[6490026]=new thumbnail(6490026,"357456","Vantage Point Photos Events","IMG_0589_thumb.jpg",130,195,1);thumbnails[2122730]=new thumbnail(2122730,"141184","","_MG_6310_thumb.jpg",120,80,1);thumbnails[5664255]=new thumbnail(5664255,"141192","SA Eye glasses","SA_CA6143_VS2_XD258_thumb.jpg",130,93,1);thumbnails[6490031]=new thumbnail(6490031,"357456","Vantage Point Photos Events","IMG_0592_thumb.jpg",130,87,1);thumbnails[2122731]=new thumbnail(2122731,"141184","","_MG_6316_thumb.jpg",120,80,1);thumbnails[6490032]=new thumbnail(6490032,"357456","Vantage Point Photos Events","IMG_0604_thumb.jpg",130,195,1);thumbnails[2122732]=new thumbnail(2122732,"141184","","_MG_6334_thumb.jpg",120,80,1);thumbnails[6490033]=new thumbnail(6490033,"357456","Vantage Point Photos Events","IMG_0623_thumb.jpg",130,87,1);thumbnails[2122734]=new thumbnail(2122734,"141184","","_MG_6540_thumb.jpg",120,80,1);thumbnails[2122733]=new thumbnail(2122733,"141184","","_MG_6507_thumb.jpg",120,80,1);thumbnails[6490034]=new thumbnail(6490034,"357456","Vantage Point Photos Events","IMG_0653_thumb.jpg",130,87,1);thumbnails[2122689]=new thumbnail(2122689,"141184","","IMG_7247_thumb.jpg",120,80,1);thumbnails[6490036]=new thumbnail(6490036,"357456","Vantage Point Photos Events","IMG_0680_thumb.jpg",130,87,1);thumbnails[6490037]=new thumbnail(6490037,"357456","Vantage Point Photos Events","IMG_0699_thumb.jpg",130,87,1);thumbnails[6490040]=new thumbnail(6490040,"357456","Vantage Point Photos Events","IMG_0504_thumb.jpg",130,86,1);thumbnails[6490041]=new thumbnail(6490041,"357456","Vantage Point Photos Events","IMG_0571_thumb.jpg",130,195,1);thumbnails[6490042]=new thumbnail(6490042,"357456","Vantage Point Photos Events","IMG_0638_thumb.jpg",130,86,1);thumbnails[1106966]=new thumbnail(1106966,"115778","Bears Paw Pub, Brereton","bears-head_thumb.jpg",120,82,1);thumbnails[1106969]=new thumbnail(1106969,"115778","Nottingham","CRW_12071_thumb.jpg",120,85,1);thumbnails[1106974]=new thumbnail(1106974,"115778","Preston, Cheshire","ed_IMG_75011_thumb.jpg",120,90,1);thumbnails[1106979]=new thumbnail(1106979,"115778","Runcorn","IMG_19533_thumb.jpg",120,90,1);thumbnails[1107027]=new thumbnail(1107027,"115778","Bury, Lancashire","parcelnet1_thumb.jpg",120,87,1);thumbnails[5664247]=new thumbnail(5664247,"115778","Deeside Park","CRW_4979_thumb.jpg",130,95,1);thumbnails[5664248]=new thumbnail(5664248,"115778","Lymm, Cheshire","CRW_5568_thumb.jpg",130,95,1);thumbnails[5664249]=new thumbnail(5664249,"115778","Nursery School, Stoke on Trent","CRW_6581_thumb.jpg",130,98,1);thumbnails[6037388]=new thumbnail(6037388,"115778","Knutsford","IMG_6907_thumb.jpg",130,98,1);thumbnails[5664267]=new thumbnail(5664267,"115778","Trafford Park, Manchester","CRW_2841_thumb.jpg",130,100,1);thumbnails[5664268]=new thumbnail(5664268,"115778","Eaton Place, Sale","Second_CRW_8479_thumb.jpg",130,87,1);thumbnails[1107005]=new thumbnail(1107005,"115782","Night Club, Chester","IMG_41781_thumb.jpg",120,80,1);thumbnails[1107012]=new thumbnail(1107012,"115782","Prestbury High Street","IMG_61101_thumb.jpg",120,60,1);thumbnails[1107015]=new thumbnail(1107015,"115782","Terry Dwyer, Pure Cheshire Magazine","IMG_74101_thumb.jpg",120,169,1);thumbnails[1107016]=new thumbnail(1107016,"115782","Interior Photography, Cheshire","IMG_75881_thumb.jpg",120,72,1);thumbnails[1723318]=new thumbnail(1723318,"115782","Braemar","_6272_thumb.jpg",120,180,1);thumbnails[2295854]=new thumbnail(2295854,"115782","","IMG_7661_thumb.jpg",120,80,1);thumbnails[5662811]=new thumbnail(5662811,"115782","Braemar CEO","-6854_thumb.jpg",130,92,1);thumbnails[2295855]=new thumbnail(2295855,"115782","","IMG_7681_thumb.jpg",120,80,1);thumbnails[5662812]=new thumbnail(5662812,"115782","Braemar CEO","-6923_thumb.jpg",130,98,1);thumbnails[6037389]=new thumbnail(6037389,"115782","Kitchen, Cheshire","IMG_8793_D92A578E-24E8-5EC4-4FB4D02F60311FF5_thumb.jpg",130,173,1);thumbnails[5659337]=new thumbnail(5659337,"115782","Terry Dwyer","IMG_9405_2_thumb.jpg",130,195,1);thumbnails[5664251]=new thumbnail(5664251,"115782","Kitchen Design","IMG_7612_720BF338-1EC9-D45B-1C823F1F9F27F935_thumb.jpg",130,87,1);thumbnails[5659338]=new thumbnail(5659338,"115782","Gordon Dunn, Winsford Salt Mine","IMG_9576_thumb.jpg",130,87,1);thumbnails[6037391]=new thumbnail(6037391,"115782","Spinningfields Penthouse, Manchester","IMG_9411_D92A5A9C-24E8-5EC4-4F74C656ED8A2DCD_thumb.jpg",130,87,1);thumbnails[1106960]=new thumbnail(1106960,"115784","Chartered Surveyors","_MG_00712_thumb.jpg",120,90,1);thumbnails[1106997]=new thumbnail(1106997,"115784","Easter Development Group","IMG_23111_thumb.jpg",120,180,1);thumbnails[1107019]=new thumbnail(1107019,"115784","Kitchen interior","IMG_77311_thumb.jpg",120,83,1);thumbnails[5659331]=new thumbnail(5659331,"115784","Centenary Park","CRW_2844_thumb.jpg",130,91,1);thumbnails[5659607]=new thumbnail(5659607,"115784","CP Hart","IMG_6794_thumb.jpg",130,195,1);thumbnails[5659662]=new thumbnail(5659662,"115784","Greenlink","IMG_1503_thumb.jpg",130,87,1);thumbnails[6037384]=new thumbnail(6037384,"115784","Townhouse, Altrincham","CRW_5595_thumb.jpg",130,97,1);thumbnails[5659332]=new thumbnail(5659332,"115784","Trafford Park Central","CRW_5969_thumb.jpg",130,98,1);thumbnails[5659608]=new thumbnail(5659608,"115784","CP Hart","IMG_6846_thumb.jpg",130,87,1);thumbnails[5659663]=new thumbnail(5659663,"115784","Greenlink","IMG_1554_thumb.jpg",130,195,1);thumbnails[6037385]=new thumbnail(6037385,"115784","Residential property","CRW_5603_thumb.jpg",130,87,1);thumbnails[5659333]=new thumbnail(5659333,"115784","Trafford Park Central","IMG_3958_thumb.jpg",130,198,1);thumbnails[5659609]=new thumbnail(5659609,"115784","CP Hart","IMG_6851_thumb.jpg",130,87,1);thumbnails[5659664]=new thumbnail(5659664,"115784","Greenlink","IMG_1575_thumb.jpg",130,87,1);thumbnails[5659334]=new thumbnail(5659334,"115784","Trafford Park Central","IMG_3977_thumb.jpg",130,195,1);thumbnails[5659335]=new thumbnail(5659335,"115784","Deeside Park","IMG_7917_thumb.jpg",130,97,1);thumbnails[5659336]=new thumbnail(5659336,"115784","Deeside Park","IMG_7928_thumb.jpg",130,98,1);thumbnails[5664250]=new thumbnail(5664250,"115784","Manchester Swimming Championships","IMG_7247_720BF1B1-1EC9-D45B-1C725AE805612D15_thumb.jpg",130,87,1);thumbnails[6037390]=new thumbnail(6037390,"115784","Spinningfields, Manchester","IMG_9370_thumb.jpg",130,195,1);thumbnails[6037392]=new thumbnail(6037392,"115784","Buckshaw Village","IMG_9417_thumb.jpg",130,96,1);thumbnails[6037393]=new thumbnail(6037393,"115784","Buckshaw Village","IMG_9429_thumb.jpg",130,174,1);thumbnails[1723241]=new thumbnail(1723241,"115785","","_9277_thumb.jpg",120,83,1);thumbnails[1723242]=new thumbnail(1723242,"115785","","CRW_7659_thumb.jpg",120,90,1);thumbnails[1723243]=new thumbnail(1723243,"115785","","CRW_7991_thumb.jpg",120,90,1);thumbnails[1723245]=new thumbnail(1723245,"115785","","IMG_1059_thumb.jpg",120,80,1);thumbnails[1723246]=new thumbnail(1723246,"115785","","IMG_1158_thumb.jpg",120,80,1);thumbnails[1723247]=new thumbnail(1723247,"115785","","IMG_1181_thumb.jpg",120,173,1);thumbnails[1723257]=new thumbnail(1723257,"115785","","IMG_1394_thumb.jpg",120,90,1);thumbnails[1723258]=new thumbnail(1723258,"115785","","IMG_1700_thumb.jpg",120,80,1);thumbnails[1723259]=new thumbnail(1723259,"115785","","IMG_2124_thumb.jpg",120,88,1);var galleries=new Object();galleries[141184]=new gallery(141184,"2122689","AstralPool","section151586",[2122723,2122722,2122684,2122685,2122686,2122687,2122688,2122721,2122690,2122730,2122731,2122732,2122734,2122733,2122689]);galleries[357456]=new gallery(357456,"6490042,6490041,6490040,6490037,6490036,6490034,6490033,6490032,6490031,6490026","Cricket Day","section151586",[6490017,6490018,6490019,6490020,6490023,6490024,6490025,6490026,6490031,6490032,6490033,6490034,6490036,6490037,6490040,6490041,6490042]);galleries[150414]=new gallery(150414,"2295938,2295845,2295833,2295792,2295789,2295788,1107021,1107013,1107003,1107002","Fine Art Prints","section192526",[2295845,2295833,1107003,2295789,1107021,1107013,1106977,1107002,2295792,2295938,2295788]);galleries[150423]=new gallery(150423,"2295862,2295861,2295860,2295859,2295858,2295857,2295856","My Buro","section151586",[2295856,2295857,2295858,2295859,2295860,2295861,2295862]);galleries[141192]=new gallery(141192,"5664255,5664254,5664246,4782207,4782206,4782205,4782204,4782203,2446949,2122891","Product Photography","section182127",[1107751,1107754,1107757,2122891,2446949,4782203,5664246,4782204,4782205,4782206,4782207,5664254,5664255]);galleries[363331]=new gallery(363331,"6656352,6656351,6656350,6656349,6656348,6632518","Training Course Payments","section432815",[6632518,6656348,6656349,6656350,6656351,6656352]);galleries[115778]=new gallery(115778,"6037388,5664268,5664267,5664249,5664248,5664247,1107027,1106979,1106974,1106969","Aerial","section127622",[1106966,1106969,1106974,1106979,1107027,5664247,5664248,5664249,6037388,5664267,5664268]);galleries[115782]=new gallery(115782,"6037391,6037389,5664251,5662812,5662811,5659338,5659337,2295855,2295854,1723318","Editorial & PR","section127823",[1107005,1107012,1107015,1107016,1723318,2295854,5662811,2295855,5662812,6037389,5659337,5664251,5659338,6037391]);galleries[115784]=new gallery(115784,"6037393,6037392,6037390,6037385,6037384,5664250,5659664,5659663,5659662,5659609","Commercial","section127826",[1106960,1106997,1107019,5659331,5659607,5659662,6037384,5659332,5659608,5659663,6037385,5659333,5659609,5659664,5659334,5659335,5659336,5664250,6037390,6037392,6037393]);galleries[115785]=new gallery(115785,"1723259,1723258,1723257,1723247,1723246,1723245,1723243,1723242,1723241","B2B Northwest","section151586",[1723241,1723242,1723243,1723245,1723246,1723247,1723257,1723258,1723259]);var imageSets=new Object();imageSets[1]="6490024,2295833,2122689,2122688,1107019,1107003,1106975";imageSets[2]="2122689";imageSets[3]="6656352,6656351,6656350,6656349,6656348,6632518,6490042,6490041,6490040,6490037,6490036,6490034,6490033,6490032,6490031,6490026,6490025,6490024,6490023,6490020,6490019,6490018,6490017,6037393,6037392,6037391,6037390,6037389,6037388,6037385,6037384,5664268,5664267,5664255,5664254,5664251,5664250,5664249,5664248,5664247,5664246,5662812,5662811,5659664,5659663,5659662,5659609,5659608,5659607,5659338";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/garybeal1/images";break}switch(a){case 1:b="http://www1.clikpic.com/garybeal1/images";break}switch(a){case 2:b="http://admin.clikpic.com/garybeal1/images";break}switch(a){case 24:b="http://tpc15/clikpic/garybeal1/images";break}switch(a){case 4:b="http://www.clikchurch.com/garybeal1/images";break}switch(a){case 5:b="http://www2.clikpic.com/garybeal1/images";break}switch(a){case 22:b="http://tpc5/clikpic/garybeal1/images";break}switch(a){case 23:b="http://tpc10/clikpic/garybeal1/images";break}switch(a){case 25:b="http://tpc16/clikpic/garybeal1/images";break}switch(a){case 15:b="http://www3.clikpic.com/garybeal1/images";break}switch(a){case 18:b="http://www4.clikpic.com/garybeal1/images";break}switch(a){case 19:b="http://www5.clikpic.com/garybeal1/images";break}switch(a){case 31:b="http://www7.clikpic.com/garybeal1/images";break}switch(a){case 32:b="http://admin2.clikpic.com/garybeal1/images";break}switch(a){case 33:b="http://www8.clikpic.com/garybeal1/images";break}switch(a){case 34:b="http://www9.clikpic.com/garybeal1/images";break}switch(a){case 35:b="http://admin3.clikpic.com/garybeal1/images";break}switch(a){case 37:b="http://admin4.clikpic.com/garybeal1/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("section127826"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section127826.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("section127826"!=""){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="Vantage Point Photos: "+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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';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">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="GARYBEAL1">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";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+'")'})}}};