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[2833863]=new thumbnail(2833863,"","","Me and My Camera_thumb.jpg",130,98,32);thumbnails[2804054]=new thumbnail(2804054,"175382","BLACK BECK TARN","Black Beck Camp e r s_thumb.jpg",130,87,32);thumbnails[2804127]=new thumbnail(2804127,"175382","","UNKNOWN SCOTLAND e r s_thumb.jpg",130,87,32);thumbnails[2804217]=new thumbnail(2804217,"175382","BEN LUI","Ben Lui e r s_thumb.jpg",60,90,32);thumbnails[2804578]=new thumbnail(2804578,"175382","WHITE OUT ON BEN MORE","Ben More White Out e r s _thumb.jpg",60,90,32);thumbnails[2840509]=new thumbnail(2840509,"175382","HEADING FOR THE HILLS","Heading For The Hills_thumb.jpg",130,87,32);thumbnails[2842724]=new thumbnail(2842724,"175382","","HELVELLYN_thumb.jpg",130,87,32);thumbnails[2846218]=new thumbnail(2846218,"175382","","INVERSION e r s_thumb.jpg",130,87,32);thumbnails[2846232]=new thumbnail(2846232,"175382","BEN NEVIS","EASTER ON THE BEN_thumb.jpg",130,87,32);thumbnails[2846259]=new thumbnail(2846259,"175382","SKINNY DIPPING","SKINNY DIPPING_thumb.jpg",68,90,32);thumbnails[2875479]=new thumbnail(2875479,"175382","","tripple buttress_thumb.jpg",129,86,32);thumbnails[4827319]=new thumbnail(4827319,"175382","","img104_e_r_s_thumb.jpg",60,90,32);thumbnails[2108396]=new thumbnail(2108396,"141349","Lindsell ","welcome_thumb.jpg",130,97,32);thumbnails[2126151]=new thumbnail(2126151,"141349","STEBBING","webessex-1_thumb.jpg",130,97,32);thumbnails[2126205]=new thumbnail(2126205,"141349","GREAT EASTON","WINTER-b_thumb.jpg",130,92,32);thumbnails[2216229]=new thumbnail(2216229,"141349","GREAT BARDFIELD","great bardfield_thumb.jpg",119,89,32);thumbnails[2266926]=new thumbnail(2266926,"141349","High Beech, Epping Forest","High Beech e r s w_thumb.jpg",130,98,32);thumbnails[2307857]=new thumbnail(2307857,"141349","Lindsell","Trees near Lindsell_thumb.jpg",130,98,32);thumbnails[2317024]=new thumbnail(2317024,"141349","St Osyth's Creek","img011 r s w_thumb.jpg",130,97,32);thumbnails[2317027]=new thumbnail(2317027,"141349","St Osyths Creek","img012 r s w_thumb.jpg",130,90,32);thumbnails[2317043]=new thumbnail(2317043,"141349","Spring meadows, Hatfield Forest","OAK TREE 01 e r s w_thumb.jpg",130,97,32);thumbnails[2322859]=new thumbnail(2322859,"141349","THAXTED","Thaxted Guildhall e r s w_thumb.jpg",130,99,32);thumbnails[2863363]=new thumbnail(2863363,"141349","SECRET WOOD","SECRET WOOD_thumb.jpg",120,90,32);thumbnails[2863456]=new thumbnail(2863456,"141349","alresford creek","ALRESFORD CREEK e r s_thumb.jpg",120,89,32);thumbnails[4798785]=new thumbnail(4798785,"141349","Lindsell","Oak_Tree_Lindsell_c_e_r_s_thumb.jpg",68,90,32);thumbnails[4798791]=new thumbnail(4798791,"141349","Hatfield Forest","Hatfield_Forest__e_c_r_s_thumb.jpg",82,90,32);thumbnails[4827315]=new thumbnail(4827315,"141349","Hatfield Forest","HATFIELD_FOREST_060__e_r_s_website_thumb.jpg",120,90,32);thumbnails[5253515]=new thumbnail(5253515,"141349","HATFIELD FOREST","HATFIELD_FOREST_029_30_31_36_tonemapped_e_r_s_web_thumb.jpg",120,90,32);thumbnails[5290440]=new thumbnail(5290440,"141349","HATFIELD FOREST","HATFIELD_FOREST_002_e_r_s_web_thumb.jpg",120,90,32);thumbnails[5316093]=new thumbnail(5316093,"141349","NEAR LINDSELL","RAKEFAIRS_047_49_50_tonemapped_e_V5_r_s_web_thumb.jpg",120,90,32);thumbnails[2263665]=new thumbnail(2263665,"148783","Stormy Evening at Brancaster Staithe","NORFOLK 002 edited r s_thumb.jpg",130,63,32);thumbnails[2317004]=new thumbnail(2317004,"148783","Beach Huts at Wells-Next-The-Sea","BEACH HUTS WNTS c e r s w_thumb.jpg",130,111,32);thumbnails[2317008]=new thumbnail(2317008,"148783","CLEY NEXT THE SEA","CLEY NEXT THE SEA_thumb.jpg",129,64,32);thumbnails[2317012]=new thumbnail(2317012,"148783","Burnham Overy Staithe at dawn","BURNHAM O S DAWN c e r w_thumb.jpg",130,83,32);thumbnails[2317020]=new thumbnail(2317020,"148783","Burnham Overy Staithe","img006 e_thumb.jpg",130,98,32);thumbnails[2317046]=new thumbnail(2317046,"148783","Burnham Overy Staithe","IMAGE_07_thumb.jpg",130,64,32);thumbnails[2322925]=new thumbnail(2322925,"148783","BRANCASTER STAITHE","Brancaster Staithe Sunset Norfolk e s r w _thumb.jpg",130,98,32);thumbnails[2808261]=new thumbnail(2808261,"148783","THORNHAM CREEK","THORNHAM_tonemapped e3 r s_thumb.jpg",130,98,32);thumbnails[2863647]=new thumbnail(2863647,"148783","HOW HILL","HOW HILL NATURE RESERVE_thumb.jpg",119,90,32);thumbnails[2376352]=new thumbnail(2376352,"149000","Wast Water","img018 e r s w_thumb.jpg",130,87,32);thumbnails[2801964]=new thumbnail(2801964,"149000","WINDERMERE","img041_thumb.jpg",130,87,32);thumbnails[2813529]=new thumbnail(2813529,"149000","INNOMINATE TARN","Innominate Tarn e r s_thumb.jpg",130,87,32);thumbnails[2813834]=new thumbnail(2813834,"149000","ULLSWATER","Ullswater e r s_thumb.jpg",130,87,32);thumbnails[2814288]=new thumbnail(2814288,"149000","CONISTON WATER","Coniston Water  e r s1_thumb.jpg",130,87,32);thumbnails[2827390]=new thumbnail(2827390,"149000","LANGDALE PIKES","Langdale Pikes_thumb.jpg",130,88,32);thumbnails[2840443]=new thumbnail(2840443,"149000","INNOMINATE TARN","Innominate Misty GG e r s_thumb.jpg",130,87,32);thumbnails[2840490]=new thumbnail(2840490,"149000","DEVOKE WATER","Devoke Water e r s_thumb.jpg",130,87,32);thumbnails[2840500]=new thumbnail(2840500,"149000","BUTTERMERE VALLEY","Buttermere Valley e r s_thumb.jpg",130,87,32);thumbnails[2840510]=new thumbnail(2840510,"149000","ULLSWATER AT DUSK","ULLSWATER AT DUSK e r s_thumb.jpg",130,87,32);thumbnails[2842692]=new thumbnail(2842692,"149000","DERWENT WATER","DERWENT WATER e r s_thumb.jpg",130,87,32);thumbnails[2846481]=new thumbnail(2846481,"149000","BUTTERMERE","BUTTERMERE SUNSET_thumb.jpg",130,87,32);thumbnails[2846670]=new thumbnail(2846670,"149000","ST JOHN'S VALE","VALE ST JOHN_thumb.jpg",130,75,32);thumbnails[4888620]=new thumbnail(4888620,"149000","buttermere","img159_e_r_s_web_thumb.jpg",130,85,32);thumbnails[5250802]=new thumbnail(5250802,"295794","BOSHAM","WEST_SUSSEX_002_3_6_tonemapped_e_r_s_web_thumb.jpg",120,90,32);thumbnails[5250895]=new thumbnail(5250895,"295794","BOSHAM","WEST_SUSSEX_164_e_r_s_web_thumb.jpg",130,76,32);thumbnails[5250909]=new thumbnail(5250909,"295794","BOSHAM","WEST_SUSSEX_089_e_r_s_web_thumb.jpg",130,69,32);thumbnails[5250948]=new thumbnail(5250948,"295794","BOSHAM","WEST_SUSSEX_104__e_r_s_web_thumb.jpg",120,90,32);thumbnails[2801966]=new thumbnail(2801966,"149001","Beinn Eighe from the north","img091_thumb.jpg",130,87,32);thumbnails[2801967]=new thumbnail(2801967,"149001","Loch Lomond","Loch Lomond e r s_thumb.jpg",130,87,32);thumbnails[2804753]=new thumbnail(2804753,"149001","Fishing boat at dusk, near arisaig","Near Arisaig e r s_thumb.jpg",130,87,32);thumbnails[2822558]=new thumbnail(2822558,"149001","LOCH KISHORN","Loch Kishorn e r s_thumb.jpg",130,87,32);thumbnails[2822567]=new thumbnail(2822567,"149001","LOCH TULLA","Loch Tulla_thumb.jpg",130,87,32);thumbnails[2826538]=new thumbnail(2826538,"149001","","Torridon e r s_thumb.jpg",130,87,32);thumbnails[2847093]=new thumbnail(2847093,"149001","","TORRIDON REFLECTION_thumb.jpg",130,87,32);thumbnails[2847094]=new thumbnail(2847094,"149001","","skye_thumb.jpg",130,87,32);thumbnails[2863718]=new thumbnail(2863718,"149001","CALEDONIAN CANAL","CALEDONIAN CANAL_thumb.jpg",129,86,32);thumbnails[2288371]=new thumbnail(2288371,"149002","Looking across Llyn Cynwych towards Cader Idris just after sunrise.","WALES 001 e r s w_thumb.jpg",130,93,32);thumbnails[2317048]=new thumbnail(2317048,"149002","","P7302300 e s r w_thumb.jpg",130,98,32);thumbnails[2317049]=new thumbnail(2317049,"149002","","P7312321 e r s w_thumb.jpg",130,98,32);thumbnails[2323021]=new thumbnail(2323021,"149002","","Torrent Walk e s w_thumb.jpg",130,113,32);thumbnails[2323106]=new thumbnail(2323106,"149002","","TORRENT WALK  HDR r s w_thumb.jpg",130,96,32);thumbnails[2863939]=new thumbnail(2863939,"149002","","CWM GLASS_thumb.jpg",129,86,32);thumbnails[4888317]=new thumbnail(4888317,"149002","LLYN GLAS SNOWDON","IMAGE_02_thumb.jpg",120,90,32);thumbnails[4888279]=new thumbnail(4888279,"278755","ROCK ISLAND COUNTY CORK","IMAGE_091_thumb.jpg",122,90,32);thumbnails[4888293]=new thumbnail(4888293,"278755","MOUNT GABRIEL COUNTY CORK","img115_e_r_s_web_thumb.jpg",123,90,32);thumbnails[4888615]=new thumbnail(4888615,"278755","dunmanus quay county cork","img124_e_r_s_web_thumb.jpg",123,90,32);thumbnails[4888617]=new thumbnail(4888617,"278755","inch strand dingle","img119_e_r_s_web_thumb.jpg",123,90,32);thumbnails[2126103]=new thumbnail(2126103,"145721","Sunrise at Embleton Bay","EMBLETON-BAY-SUNRISE-e-s-r-1_thumb.jpg",130,81,32);thumbnails[2322964]=new thumbnail(2322964,"145721","LEEDS CASTLE","LEEDS CASTLE r s w_thumb.jpg",130,98,32);thumbnails[2323087]=new thumbnail(2323087,"145721","","WOBURN TONEMAPPED CHURCH r s w_thumb.jpg",130,107,32);thumbnails[2333742]=new thumbnail(2333742,"145721","PORT MULGRAVE NORTH YORKSHIRE","PORT MULGRAVE SUNRISE_thumb.jpg",130,98,32);thumbnails[2333770]=new thumbnail(2333770,"145721","SKINNINGROVE NORTH YORKSHIRE ","SKILLINGDALE_thumb.jpg",130,102,32);thumbnails[2822583]=new thumbnail(2822583,"145721","KENSAL GREEN CEMETERY","KENSAL GREEN 066 e r s_thumb.jpg",68,90,32);thumbnails[2826684]=new thumbnail(2826684,"145721","SWALEDALE","SWALEDALE c e r s_thumb.jpg",80,90,32);thumbnails[2826895]=new thumbnail(2826895,"145721","SWALEDALE","SWALEDALE e r s_thumb.jpg",130,87,32);thumbnails[4798774]=new thumbnail(4798774,"145721","Spurn Point, Yorkshire","Spurn_Point_thumb.jpg",120,90,32);thumbnails[4888056]=new thumbnail(4888056,"145721","LEEDS CASTLE, KENT","IMAGE_03_thumb.jpg",120,90,32);thumbnails[4888630]=new thumbnail(4888630,"145721","dove valley peak district","img125_e_r_s_web_thumb.jpg",123,90,32);thumbnails[4888677]=new thumbnail(4888677,"145721","walberswick suffolk","img138_e_r_s_web_thumb.jpg",130,57,32);thumbnails[2333802]=new thumbnail(2333802,"145728","GREYLAG GOOSE IN FLIGHT","GREYLAG GOOSE1_thumb.jpg",130,104,32);thumbnails[2805168]=new thumbnail(2805168,"145728","Spider Monkey","SPIDER MONKEY e r s_thumb.jpg",130,104,32);thumbnails[2805467]=new thumbnail(2805467,"145728","Robin","GARDEN ROBIN 191 e r s_thumb.jpg",130,98,32);thumbnails[2805468]=new thumbnail(2805468,"145728","diving grebe","Diving Grebe c e r s_thumb.jpg",130,86,32);thumbnails[2805475]=new thumbnail(2805475,"145728","kestrel","KESTREL e r s_thumb.jpg",130,98,32);thumbnails[2805476]=new thumbnail(2805476,"145728","mother hen","MOTHER HEN e r s_thumb.jpg",130,104,32);thumbnails[4827322]=new thumbnail(4827322,"145728","peacock butterfly","NORFOLK_047_e_r_s_website_thumb.jpg",126,90,32);thumbnails[2271679]=new thumbnail(2271679,"149003","Snowdrops","Snowdrops r s w_thumb.jpg",130,98,32);thumbnails[2333812]=new thumbnail(2333812,"149003","STRAWBERRY","STRAWBERRY_thumb.jpg",130,98,32);thumbnails[2375434]=new thumbnail(2375434,"149003","Poppy Close-up","img007 r s_thumb.jpg",130,85,32);thumbnails[2842873]=new thumbnail(2842873,"149003","COUNTERFEIT STONES","COUNTERFEIT STONES e r s_thumb.jpg",72,90,32);thumbnails[2843061]=new thumbnail(2843061,"149003","THERMAL IMAGE","Science Museum Thermal Image 72ppi r_thumb.jpg",120,90,32);thumbnails[2846764]=new thumbnail(2846764,"149003","POPPIES","POPPIES c e r s_thumb.jpg",130,89,32);thumbnails[4798790]=new thumbnail(4798790,"149003","Me and My Shadows","211_Double_Shadow_c_e_r_s__2_thumb.jpg",117,90,32);thumbnails[4827324]=new thumbnail(4827324,"149003","the searchers","P6282389_e_s_website_thumb.jpg",72,90,32);thumbnails[4827325]=new thumbnail(4827325,"149003","stuffed frogs","SCIENCE_MUSEUM_098_e_s_website_thumb.jpg",64,90,32);thumbnails[4861576]=new thumbnail(4861576,"149003","Inverted Reflection","img207_e_r_s1_thumb.jpg",130,87,32);thumbnails[2323081]=new thumbnail(2323081,"177066","","w1_thumb.jpg",130,98,32);thumbnails[2822574]=new thumbnail(2822574,"177066","KENSAL GREEN CEMETERY","KENSAL GREEN 026 b&w e r c s_thumb.jpg",130,98,32);thumbnails[2843246]=new thumbnail(2843246,"177066","WINDY DAY","WINDY DAY John Perriment r s_thumb.jpg",130,87,32);thumbnails[5253519]=new thumbnail(5253519,"177066","HATFIELD FOREST","HATFIELD_FOREST_029_30_31_36_tonemapped_e_BW_r_s_web_thumb.jpg",120,90,32);var galleries=new Object();galleries[175382]=new gallery(175382,"2804054","THE HILLS ARE ALIVE","gallery",[2804054,2804127,2804217,2804578,2840509,2842724,2846218,2846232,2846259,2875479,4827319]);galleries[141349]=new gallery(141349,"2126151","ESSEX","gallery",[2108396,2126151,2126205,2216229,2266926,2307857,2317024,2317027,2317043,2322859,2863363,2863456,4798785,4798791,4827315,5253515,5290440,5316093]);galleries[148783]=new gallery(148783,"2317020","NORFOLK","gallery",[2263665,2317004,2317008,2317012,2317020,2317046,2322925,2808261,2863647]);galleries[149000]=new gallery(149000,"2376352","THE LAKE DISTRICT","gallery",[2376352,2801964,2813529,2813834,2814288,2827390,2840443,2840490,2840500,2840510,2842692,2846481,2846670,4888620]);galleries[295794]=new gallery(295794,"5250948","SUSSEX","gallery",[5250802,5250895,5250909,5250948]);galleries[149001]=new gallery(149001,"2801966","SCOTLAND","gallery",[2801966,2801967,2804753,2822558,2822567,2826538,2847093,2847094,2863718]);galleries[149002]=new gallery(149002,"2288371","WALES","gallery",[2288371,2317048,2317049,2323021,2323106,2863939,4888317]);galleries[278755]=new gallery(278755,"4888617,4888615,4888293,4888279","IRELAND","gallery",[4888279,4888293,4888615,4888617]);galleries[145721]=new gallery(145721,"2322964","OTHER PLACES","gallery",[2126103,2322964,2323087,2333742,2333770,2822583,2826684,2826895,4798774,4888056,4888630,4888677]);galleries[145728]=new gallery(145728,"2805475","FUR & FEATHERS","gallery",[2333802,2805168,2805467,2805468,2805475,2805476,4827322]);galleries[149003]=new gallery(149003,"2333812","MISCELLANEOUS","gallery",[2271679,2333812,2375434,2842873,2843061,2846764,4798790,4827324,4827325,4861576]);galleries[177066]=new gallery(177066,"5253519,2843246,2822574,2323081","BLACK & WHITE","gallery",[2323081,2822574,2843246,5253519]);var imageSets=new Object();imageSets[1]="2108396";imageSets[2]="5250948,2805475,2804054,2801966,2376352,2333812,2322964,2317020,2288371,2126151";imageSets[3]="5316093,5290440,5253519,5253515,5250948,5250909,5250895,5250802,4888677,4888630,4888620,4888617,4888615,4888317,4888293,4888279,4888056,4861576,4827325,4827324,4827322,4827319,4827315,4798791,4798790,4798785,4798774,2875479,2863939,2863718,2863647,2863456,2863363,2847094,2847093,2846764,2846670,2846481,2846259,2846232,2846218,2843246,2843061,2842873,2842724,2842692,2840510,2840509,2840500,2840490";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/johnperriment/images";break}switch(a){case 1:b="http://www1.clikpic.com/johnperriment/images";break}switch(a){case 2:b="http://admin.clikpic.com/johnperriment/images";break}switch(a){case 4:b="http://www.clikchurch.com/johnperriment/images";break}switch(a){case 5:b="http://www2.clikpic.com/johnperriment/images";break}switch(a){case 15:b="http://www3.clikpic.com/johnperriment/images";break}switch(a){case 21:b="http://www6.clikpic.com/johnperriment/images";break}switch(a){case 18:b="http://www4.clikpic.com/johnperriment/images";break}switch(a){case 19:b="http://www5.clikpic.com/johnperriment/images";break}switch(a){case 22:b="http://tpc5/clikpic/johnperriment/images";break}switch(a){case 23:b="http://tpc10/clikpic/johnperriment/images";break}switch(a){case 24:b="http://tpc15/clikpic/johnperriment/images";break}switch(a){case 25:b="http://tpc16/clikpic/johnperriment/images";break}switch(a){case 31:b="http://www7.clikpic.com/johnperriment/images";break}switch(a){case 32:b="http://admin2.clikpic.com/johnperriment/images";break}switch(a){case 33:b="http://www8.clikpic.com/johnperriment/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="John Perriment Photography: "+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+'")'})}}};