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[2038985]=new thumbnail(2038985,"211420","Lofoten Panorama","lofoten-(119)-lofoten-(126)b_thumb.jpg",130,36,5);thumbnails[2038994]=new thumbnail(2038994,"211420","Reine, Lofoten","lofoten-(266)-lofoten-(272)b_thumb.jpg",130,47,5);thumbnails[2038996]=new thumbnail(2038996,"211420","Lofoten Sunrise","lofoten2007_0108_thumb.jpg",130,46,5);thumbnails[2084140]=new thumbnail(2084140,"191634","","20081112_154037_thumb.jpg",130,87,5);thumbnails[2159079]=new thumbnail(2159079,"142542","Common Lizard","20080505_120217_thumb.jpg",130,87,5);thumbnails[2287904]=new thumbnail(2287904,"142542","Peregrine","DSC_0106_thumb.jpg",130,87,5);thumbnails[2296005]=new thumbnail(2296005,"142542","Arran Seal","DSC_0056_thumb.jpg",130,86,5);thumbnails[2296008]=new thumbnail(2296008,"142542","Pheasant","DSC_0025_thumb.jpg",130,86,5);thumbnails[2296013]=new thumbnail(2296013,"142542","Red Stag","DSC_0108_thumb.jpg",130,86,5);thumbnails[2296014]=new thumbnail(2296014,"142542","Ferns","DSC_0130_thumb.jpg",130,86,5);thumbnails[2296017]=new thumbnail(2296017,"142542","Goanna","image0005_thumb.jpg",130,85,5);thumbnails[2296018]=new thumbnail(2296018,"142542","Romantic Mushrooms!","DSC_0222_thumb.jpg",87,130,5);thumbnails[2296023]=new thumbnail(2296023,"142542","Echinacea","20080821_163212_thumb.jpg",130,87,5);thumbnails[2645838]=new thumbnail(2645838,"160770","Coiling ropes at sunset","coiling_thumb.jpg",87,130,5);thumbnails[2645936]=new thumbnail(2645936,"160770","Winter mountaineering in South Wales","Image1_thumb.jpg",130,85,5);thumbnails[2891369]=new thumbnail(2891369,"160770",'Climbing "Swallows Nest" (VS 4c, 4b)',"DSC_0050_thumb.jpg",129,86,5);thumbnails[2891384]=new thumbnail(2891384,"160770",'Climbing "Freedom Direct" (HVS 4b, 5b)',"DSC_0065_2_thumb.jpg",129,86,5);thumbnails[2964570]=new thumbnail(2964570,"191656","Paddling around the Heritage Coast","20080923_182158_thumb.jpg",130,87,5);thumbnails[3076989]=new thumbnail(3076989,"160770","Cascade de Lillaz","20060109_090734_thumb.jpg",86,130,5);thumbnails[3077006]=new thumbnail(3077006,"160770","Solo climbing on Little Tor","image0013_thumb.jpg",85,130,5);thumbnails[3077007]=new thumbnail(3077007,"160770","Box Bay cragging","Image2_thumb.jpg",85,130,5);thumbnails[3123489]=new thumbnail(3123489,"191634","","20081112_154631_thumb.jpg",130,87,5);thumbnails[3123491]=new thumbnail(3123491,"191634","","activity (9)_thumb.jpg",130,87,5);thumbnails[3123492]=new thumbnail(3123492,"142542","","20081119_131355_thumb.jpg",130,87,5);thumbnails[3123794]=new thumbnail(3123794,"142542","Yellow Stagshorn","20081119_121548_thumb.jpg",130,87,5);thumbnails[3530768]=new thumbnail(3530768,"211420","Brecon Beacons","0_thumb.jpg",130,46,5);thumbnails[3530775]=new thumbnail(3530775,"160770","Torpantau Falls","20081230_104158_thumb.jpg",130,87,5);thumbnails[3530789]=new thumbnail(3530789,"211420","Winter Beacons","mountains_22_thumb.jpg",130,46,5);thumbnails[3530797]=new thumbnail(3530797,"160770","Hidden Gully","20081210_130911_thumb.jpg",87,130,5);thumbnails[2101246]=new thumbnail(2101246,"135866","","WallyLucyWedding_138_thumb.jpg",130,87,5);thumbnails[2101250]=new thumbnail(2101250,"135866","","DSC_0028_thumb.jpg",87,130,5);thumbnails[2044830]=new thumbnail(2044830,"135866","","_DSC0061_thumb.jpg",87,130,5);thumbnails[2101265]=new thumbnail(2101265,"135866","","DSC_0043_thumb.jpg",130,87,5);thumbnails[2044832]=new thumbnail(2044832,"135866","","DSC_0078a_thumb.jpg",87,130,5);thumbnails[2101333]=new thumbnail(2101333,"135866","","DSC_0047_thumb.jpg",87,130,5);thumbnails[2027314]=new thumbnail(2027314,"135839","Nash Point","nashpt0037_thumb.jpg",130,86,5);thumbnails[2027340]=new thumbnail(2027340,"135839","Waterfall","_DSC0054_thumb.jpg",87,130,5);thumbnails[2027342]=new thumbnail(2027342,"135839","Sgwd Uchaf Ddwli (Upper Ddwli Falls)","_DSC0081_gf1_thumb.jpg",130,87,5);thumbnails[2027414]=new thumbnail(2027414,"135839","Lighthouse","DSC_0046_thumb.jpg",86,130,5);thumbnails[2038966]=new thumbnail(2038966,"135839","Nash Point","_DSC0033_thumb.jpg",130,87,5);thumbnails[2038981]=new thumbnail(2038981,"135839","Gospel Pass","DSC_0030_thumb.jpg",130,86,5);thumbnails[2101400]=new thumbnail(2101400,"135839","Sugarloaf","20080412_1435101_thumb.jpg",130,87,5);thumbnails[2802850]=new thumbnail(2802850,"135839","Snowdon Sunset","BerwynSunse_thumb.jpg",130,86,5);thumbnails[2802851]=new thumbnail(2802851,"135839","Storm Waves","20080903_190611_thumb.jpg",130,87,5);thumbnails[2802853]=new thumbnail(2802853,"135839","Pembrokeshire Coast","DSC_0041_thumb.jpg",130,87,5);thumbnails[2802856]=new thumbnail(2802856,"135839","Tryfan","tryfan2_thumb.jpg",130,85,5);thumbnails[2802859]=new thumbnail(2802859,"135839","Nash Point Sunset","20060128_181205_thumb.jpg",87,130,5);thumbnails[2802862]=new thumbnail(2802862,"135839","Pembrokeshire Coastline","DSC_0055_thumb.jpg",87,130,5);thumbnails[2803100]=new thumbnail(2803100,"135839","Snowdon","mountains-(2)_thumb.jpg",130,87,5);thumbnails[2887924]=new thumbnail(2887924,"135839","Sugarloaf Sunrise","20080815_053512_thumb.jpg",129,87,5);thumbnails[2964566]=new thumbnail(2964566,"135839","Sunset on the Heritage Coast","20080923_185538_thumb.jpg",130,87,5);thumbnails[2964569]=new thumbnail(2964569,"135839","Three Cliffs Bay","20081008_115104_thumb.jpg",130,87,5);thumbnails[2965420]=new thumbnail(2965420,"135839","Sgwd Isaf Ddwli (Lower Ddwli Falls)","20081012_132648_thumb.jpg",130,87,5);thumbnails[3530776]=new thumbnail(3530776,"135839","Penarth Pier","coast_60_thumb.jpg",85,130,5);thumbnails[3530783]=new thumbnail(3530783,"135839","Stormy Beach","20090118_121031_thumb.jpg",130,87,5);thumbnails[3530786]=new thumbnail(3530786,"135839","Pontneddfechan Waterfalls","20090218_133515_thumb.jpg",130,87,5);thumbnails[2038973]=new thumbnail(2038973,"135861","Stob Corrie Nan Beith","DSC_0009_thumb.jpg",130,87,5);thumbnails[2038977]=new thumbnail(2038977,"135861","Glen Coe","DSC_0010_thumb.jpg",130,87,5);thumbnails[2038980]=new thumbnail(2038980,"135861","Loch Leven","DSC_0029_thumb.jpg",130,87,5);thumbnails[2044711]=new thumbnail(2044711,"135861","Standing Stones","DSC_0087_thumb.jpg",130,86,5);thumbnails[3530779]=new thumbnail(3530779,"135861","Hoarfrost and Snowdrifts","20090107_143552_thumb.jpg",130,87,5);thumbnails[2027467]=new thumbnail(2027467,"135862","Lofoten Sunrise","lofoten2007_0103_thumb.jpg",130,87,5);thumbnails[2038982]=new thumbnail(2038982,"135862","Hamnoy, Lofoten","lofoten2007_0295_thumb.jpg",130,87,5);thumbnails[2038983]=new thumbnail(2038983,"135862","Henningsvaer, Lofoten","lofoten2007_0086_thumb.jpg",130,87,5);thumbnails[2038987]=new thumbnail(2038987,"135862","Buneset, Lofoten","lofoten2007_0244_thumb.jpg",130,87,5);thumbnails[2044713]=new thumbnail(2044713,"135862","Lofoten Sunrise","lofoten2007_0102_thumb.jpg",130,87,5);thumbnails[2044716]=new thumbnail(2044716,"135862","Lofoten Landscape","lofoten2007_0128_thumb.jpg",130,87,5);thumbnails[2044771]=new thumbnail(2044771,"135862","Wild Camping, Å, Lofoten","lofoten2007_0201_thumb.jpg",130,87,5);var galleries=new Object();galleries[191633]=new gallery(191633,"3530797,3530775,3123491,3123489,3077007,3077006,3076989,2964570,2891384,2891369","Adventure","gallery",[]);galleries[160770]=new gallery(160770,"3530797,3530775,3077007,3077006,3076989,2891384,2891369,2645936,2645838","Climbing","gallery",[2645838,2645936,2891369,2891384,3076989,3077006,3077007,3530775,3530797]);galleries[191656]=new gallery(191656,"2964570","Kayaking","gallery",[2964570]);galleries[142541]=new gallery(142541,"3530786,3530783,3530779,3530776,2965420,2964569,2964566,2887924,2803100,2802862","Landscapes","gallery",[]);galleries[142542]=new gallery(142542,"3123794,3123492,2296023,2296018,2296017,2296014,2296013,2296008,2296005,2287904","Nature","gallery",[2159079,2287904,2296005,2296008,2296013,2296014,2296017,2296018,2296023,3123492,3123794]);galleries[211420]=new gallery(211420,"3530789,3530768,2038996,2038994,2038985","Panoramas","gallery",[2038985,2038994,2038996,3530768,3530789]);galleries[191634]=new gallery(191634,"3123491,3123489,2084140","Paragliding","gallery",[2084140,3123489,3123491]);galleries[135866]=new gallery(135866,"2101333,2101265,2101250,2101246,2044832,2044830","Weddings","gallery",[2101246,2101250,2044830,2101265,2044832,2101333]);galleries[135839]=new gallery(135839,"3530786,3530783,3530776,2965420,2964569,2964566,2887924,2803100,2802862,2802859","Wales","gallery",[2027314,2027340,2027342,2027414,2038966,2038981,2101400,2802850,2802851,2802853,2802856,2802859,2802862,2803100,2887924,2964566,2964569,2965420,3530776,3530783,3530786]);galleries[135861]=new gallery(135861,"3530779,2044711,2038980,2038977,2038973","Scotland","gallery",[2038973,2038977,2038980,2044711,3530779]);galleries[135862]=new gallery(135862,"2044771,2044716,2044713,2038987,2038983,2038982,2027467","Lofoten, Norway","gallery",[2027467,2038982,2038983,2038987,2044713,2044716,2044771]);var imageSets=new Object();imageSets[1]="3530789,3530786,3530779,3530768,3123794,3123492,3123491,3123489,2965420,2964570,2964569,2964566,2891384,2891369,2887924,2802856,2802853,2802851,2802850,2645936,2296023,2287904,2159079,2101400,2084140,2044771,2044716,2044713,2044711,2038987,2038983,2038982,2038981,2038980,2038977,2038973,2038966,2027467,2027342,2027314";imageSets[3]="3530797,3530789,3530786,3530783,3530779,3530776,3530775,3530768,3123794,3123492,3123491,3123489,3077007,3077006,3076989,2965420,2964570,2964569,2964566,2891384,2891369,2887924,2803100,2802862,2802859,2802856,2802853,2802851,2802850,2645936,2645838,2296023,2296018,2296017,2296014,2296013,2296008,2296005,2287904,2159079,2101400,2101333,2101265,2101250,2101246,2084140,2044832,2044830,2044771,2044716";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/marksalter/images";break}switch(a){case 1:b="http://www1.clikpic.com/marksalter/images";break}switch(a){case 2:b="http://admin.clikpic.com/marksalter/images";break}switch(a){case 24:b="http://tpc15/clikpic/marksalter/images";break}switch(a){case 4:b="http://www.clikchurch.com/marksalter/images";break}switch(a){case 5:b="http://www2.clikpic.com/marksalter/images";break}switch(a){case 22:b="http://tpc5/clikpic/marksalter/images";break}switch(a){case 23:b="http://tpc10/clikpic/marksalter/images";break}switch(a){case 25:b="http://tpc16/clikpic/marksalter/images";break}switch(a){case 15:b="http://www3.clikpic.com/marksalter/images";break}switch(a){case 18:b="http://www4.clikpic.com/marksalter/images";break}switch(a){case 19:b="http://www5.clikpic.com/marksalter/images";break}switch(a){case 31:b="http://www7.clikpic.com/marksalter/images";break}switch(a){case 32:b="http://admin2.clikpic.com/marksalter/images";break}switch(a){case 33:b="http://www8.clikpic.com/marksalter/images";break}switch(a){case 34:b="http://www9.clikpic.com/marksalter/images";break}switch(a){case 35:b="http://admin3.clikpic.com/marksalter/images";break}switch(a){case 37:b="http://admin4.clikpic.com/marksalter/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="Mark Salter Images: "+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="MARKSALTER">';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+'")'})}}};