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[4149600]=new thumbnail(4149600,"","A deserted beach","K_128_copy_thumb.jpg",130,86,15);thumbnails[4149611]=new thumbnail(4149611,"","Sunset, Scotland","K_164_copy_thumb.jpg",130,87,15);thumbnails[4149620]=new thumbnail(4149620,"","Rock pool, Scotland","K_216_copy_thumb.jpg",130,83,15);thumbnails[4149627]=new thumbnail(4149627,"","Common Seal ","K_278_copy_thumb.jpg",130,87,15);thumbnails[4149631]=new thumbnail(4149631,"","Rough seas, Scotland","K_381_copy_thumb.jpg",130,87,15);thumbnails[4149667]=new thumbnail(4149667,"","Wreck","K_493_copy_thumb.jpg",130,89,15);thumbnails[4149671]=new thumbnail(4149671,"","Passing Storm","K_517_copy_thumb.jpg",130,92,15);thumbnails[4149813]=new thumbnail(4149813,"","Stormy skies","K_403_copy_thumb.jpg",130,88,15);thumbnails[4149821]=new thumbnail(4149821,"","Common seal","K_264_copy_thumb.jpg",130,86,15);thumbnails[4149825]=new thumbnail(4149825,"","The Chapel at Skipness","K_334_copy_thumb.jpg",130,98,15);thumbnails[4149831]=new thumbnail(4149831,"","Carnessie Castle","K_448_copy_thumb.jpg",130,87,15);thumbnails[4443793]=new thumbnail(4443793,"","","Flag_thumb.jpg",130,114,15);thumbnails[4443808]=new thumbnail(4443808,"","","Mamer1_thumb.jpg",130,87,15);thumbnails[4443847]=new thumbnail(4443847,"","The Healing Fields","Chi_Gung_thumb.jpg",130,83,15);thumbnails[5288413]=new thumbnail(5288413,"209679","New Brighton Lighthouse ","newbrightonlh_thumb.jpg",130,87,15);thumbnails[3978151]=new thumbnail(3978151,"209679","Lindesfarne Castle, Holy Island, Northumberland","Lindesfarne_thumb.jpg",130,98,15);thumbnails[3473770]=new thumbnail(3473770,"209679","Buddhist monks, Laos","r60_thumb.jpg",130,98,15);thumbnails[3473783]=new thumbnail(3473783,"209679","Rainbow","aw0064_thumb.jpg",130,98,15);thumbnails[3473818]=new thumbnail(3473818,"209679","Early morning mist, Surrey Hills","005_thumb.jpg",130,98,15);thumbnails[3473869]=new thumbnail(3473869,"209679","Ta Prohm, Angkor, Cambodia","c94_thumb.jpg",130,98,15);thumbnails[3473883]=new thumbnail(3473883,"209679","The church of St. Peter and St. Paul, Godalming","aw031_thumb.jpg",130,98,15);thumbnails[3473902]=new thumbnail(3473902,"209679","Volcano Pacaya, Guatemala ","zz101_thumb.jpg",130,89,15);thumbnails[3474051]=new thumbnail(3474051,"209679","Pancake Ice, Wirral, Merseyside","W002_thumb.jpg",130,98,15);thumbnails[3474059]=new thumbnail(3474059,"209679","Volcano, Bolivia","n0019_thumb.jpg",130,86,15);thumbnails[3474078]=new thumbnail(3474078,"209679","People's Taxi, Cambodia","r20_thumb.jpg",130,98,15);thumbnails[3475549]=new thumbnail(3475549,"209679","The Giants Causeway, Northern Ireland","s029_thumb.jpg",130,98,15);thumbnails[3475563]=new thumbnail(3475563,"209679","Carpenter, Morocco","m001_thumb.jpg",130,98,15);thumbnails[3475578]=new thumbnail(3475578,"209679","Iceberg, Patagonia","o011_thumb.jpg",130,85,15);thumbnails[3478440]=new thumbnail(3478440,"209679","Evening on the Mekong","r51_thumb.jpg",130,98,15);thumbnails[3487118]=new thumbnail(3487118,"209679","Tate Modern, London","Tate Modern copy_thumb.jpg",130,90,15);thumbnails[3540106]=new thumbnail(3540106,"209679","Lismore Lighthouse, Scotland","light2_thumb.jpg",130,75,15);thumbnails[3621943]=new thumbnail(3621943,"209679","Table top reflection","tabletop_thumb.jpg",130,98,15);thumbnails[3852712]=new thumbnail(3852712,"209679","Children, Cambodia","Cambodiankids_thumb.jpg",130,100,15);thumbnails[3978440]=new thumbnail(3978440,"209679","Evening Light","North_Berwick_thumb.jpg",130,92,15);thumbnails[3978442]=new thumbnail(3978442,"209679","Morning Light, North Sea","water_thumb.jpg",130,86,15);thumbnails[4149550]=new thumbnail(4149550,"209679","Clear water and a still morning at Kilbury Head","K_094_copy_thumb.jpg",130,90,15);thumbnails[4149639]=new thumbnail(4149639,"209679","Stormy weather, Scotland","K_390_copy_thumb.jpg",130,87,15);thumbnails[5141489]=new thumbnail(5141489,"209679","Downtown Toronto","toronto_thumb.jpg",130,88,15);thumbnails[5498973]=new thumbnail(5498973,"209679","Winter Dawn","Winter1_thumb.jpg",130,84,15);thumbnails[5499017]=new thumbnail(5499017,"209679","Snow Shadows","winter3_thumb.jpg",130,87,15);thumbnails[5523919]=new thumbnail(5523919,"209679","Thursley Common","Thurs1_thumb.jpg",130,79,15);thumbnails[5523932]=new thumbnail(5523932,"209679","Iceberg on Grey Lake","icei_thumb.jpg",130,87,15);thumbnails[5523937]=new thumbnail(5523937,"209679","Chinese Fishing Nets","chinesenets_thumb.jpg",130,98,15);thumbnails[5523948]=new thumbnail(5523948,"209679","Hauling in, Sri Lanka","haulingin_thumb.jpg",130,85,15);thumbnails[3978496]=new thumbnail(3978496,"209680","Southern Hawker","Southernhawker_thumb.jpg",130,168,15);thumbnails[5523927]=new thumbnail(5523927,"209680","Dolphin at Monkey Mia","dolphin_thumb.jpg",130,100,15);thumbnails[3700715]=new thumbnail(3700715,"209680","Ammonites, Lyme Regis","ammonites1_thumb.jpg",130,173,15);thumbnails[3555964]=new thumbnail(3555964,"209680","Fox cub","fox_thumb.jpg",130,185,15);thumbnails[3475559]=new thumbnail(3475559,"209680","Seal Pup","C002_thumb.jpg",130,89,15);thumbnails[3475540]=new thumbnail(3475540,"209680","Western Lowland Gorilla","c040_thumb.jpg",130,98,15);thumbnails[3473824]=new thumbnail(3473824,"209680","Badger","c033_thumb.jpg",130,87,15);thumbnails[3474063]=new thumbnail(3474063,"209680","Guanaco, Chile","o012_thumb.jpg",130,89,15);thumbnails[3473971]=new thumbnail(3473971,"209680","Fallow Deer","C006_thumb.jpg",130,98,15);thumbnails[4001977]=new thumbnail(4001977,"209680","Alligators","croc_thumb.jpg",130,90,15);thumbnails[3475565]=new thumbnail(3475565,"209680","Common Starfish","s015_thumb.jpg",130,98,15);thumbnails[4149852]=new thumbnail(4149852,"209680","Common Seal","K_253_copy_thumb.jpg",130,82,15);thumbnails[3977796]=new thumbnail(3977796,"212391","Gannets, Bass Rock, Scotland","Gannets_thumb.jpg",130,88,15);thumbnails[3978092]=new thumbnail(3978092,"212391","Gannet Colony, Bass Rock","Gannet_Colony_thumb.jpg",130,87,15);thumbnails[3473376]=new thumbnail(3473376,"212391","Eider Ducks at Sunset, Orkney Islands","EiderDucks_thumb.jpg",130,98,15);thumbnails[3473906]=new thumbnail(3473906,"212391","Puffin, Scotland","B008_thumb.jpg",130,89,15);thumbnails[3473972]=new thumbnail(3473972,"212391","Nuthatch","GF020_thumb.jpg",130,89,15);thumbnails[3474043]=new thumbnail(3474043,"212391","Seabirds, Dee Estuary, Wirral, UK","B015_thumb.jpg",130,98,15);thumbnails[3475537]=new thumbnail(3475537,"212391","Turnstone","B001_thumb.jpg",130,98,15);thumbnails[3475556]=new thumbnail(3475556,"212391","Grey Heron","b023_thumb.jpg",130,98,15);thumbnails[3487246]=new thumbnail(3487246,"212391","Robin","Robin_thumb.jpg",130,110,15);thumbnails[3540243]=new thumbnail(3540243,"212391","Bower Bird","aab028_thumb.jpg",130,94,15);thumbnails[3555864]=new thumbnail(3555864,"212391","Curlew, Scotland","whimbrel_thumb.jpg",130,92,15);thumbnails[3555930]=new thumbnail(3555930,"212391","Gannet in flight","Gannet_thumb.jpg",130,81,15);thumbnails[3603063]=new thumbnail(3603063,"212391","Fledgeling Sparrow","Fledgeling_thumb.jpg",130,87,15);thumbnails[3621679]=new thumbnail(3621679,"212391","Long Tailed Tit","longtailedtit_thumb.jpg",130,89,15);thumbnails[5523921]=new thumbnail(5523921,"212391","Redshank Flock","redshank_thumb.jpg",130,98,15);thumbnails[5523922]=new thumbnail(5523922,"212391","Grey Heron in flight","heron_thumb.jpg",130,98,15);thumbnails[5871346]=new thumbnail(5871346,"212391","Great Crested Grebe with large fish","grebe1_thumb.jpg",130,91,15);thumbnails[5871351]=new thumbnail(5871351,"212391","Great Crested Grebe","grebe2_thumb.jpg",130,100,15);thumbnails[5871356]=new thumbnail(5871356,"212391","Heron in Flight","heron1_thumb.jpg",130,96,15);thumbnails[6436166]=new thumbnail(6436166,"212391","Wheatear","wheatear_thumb.jpg",130,92,15);thumbnails[3473761]=new thumbnail(3473761,"216216","Rime frost in Beech woodland","aw029_thumb.jpg",130,98,15);thumbnails[3475535]=new thumbnail(3475535,"216216","Autumn Colour","aw013_thumb.jpg",130,98,15);thumbnails[3540215]=new thumbnail(3540215,"216216","Trichoreus Cactus, Salar De Uyuni, bolivia","cacti_thumb.jpg",130,107,15);thumbnails[3540228]=new thumbnail(3540228,"216216","Autumn colour, Surrey","aw016_thumb.jpg",130,98,15);thumbnails[3555757]=new thumbnail(3555757,"216216","April snow on Cherry Blossom","w_163_thumb.jpg",130,97,15);thumbnails[3555772]=new thumbnail(3555772,"216216","Scots Pine","scots_thumb.jpg",130,95,15);thumbnails[3555810]=new thumbnail(3555810,"216216","Mossy Trunks, Scotland","moss_thumb.jpg",130,106,15);thumbnails[3603143]=new thumbnail(3603143,"216216","Magnolia Blossom","Magnolia_blossom_thumb.jpg",130,99,15);thumbnails[3621859]=new thumbnail(3621859,"216216","Fern on Oak tree","Fern_thumb.jpg",130,92,15);thumbnails[3700589]=new thumbnail(3700589,"216216","Wistmans Wood, Devon","wistmans_wood_thumb.jpg",130,88,15);thumbnails[5141416]=new thumbnail(5141416,"216216","Sweet Chestnut Leaves","aw0009_thumb.jpg",130,98,15);thumbnails[5498999]=new thumbnail(5498999,"216216","Winters Grip","winter2_thumb.jpg",130,87,15);var galleries=new Object();galleries[209679]=new gallery(209679,"5523919,3478440,3473883","People and Places","gallery",[5288413,3978151,3473770,3473783,3473818,3473869,3473883,3473902,3474051,3474059,3474078,3475549,3475563,3475578,3478440,3487118,3540106,3621943,3852712,3978440,3978442,4149550,4149639,5141489,5498973,5499017,5523919,5523932,5523937,5523948]);galleries[209680]=new gallery(209680,"3475540","Animals","gallery",[3978496,5523927,3700715,3555964,3475559,3475540,3473824,3474063,3473971,4001977,3475565,4149852]);galleries[212391]=new gallery(212391,"6436166,5871356,5871351,5871346,5523922,5523921,3978092,3977796,3621679,3603063","Birds","gallery",[3977796,3978092,3473376,3473906,3473972,3474043,3475537,3475556,3487246,3540243,3555864,3555930,3603063,3621679,5523921,5523922,5871346,5871351,5871356,6436166]);galleries[216216]=new gallery(216216,"5498999,5141416,3700589,3621859,3603143,3555810,3555772,3555757,3540228,3540215","Trees and Plants","gallery",[3473761,3475535,3540215,3540228,3555757,3555772,3555810,3603143,3621859,3700589,5141416,5498999]);var imageSets=new Object();imageSets[1]="5498973,4149667,4149627,3487118,3478440,3475565,3475540,3473906,3473869,3473770";imageSets[2]="5523919,4149667,4149627,3478440,3475540,3473883";imageSets[3]="6436166,5871356,5871351,5871346,5523948,5523937,5523932,5523927,5523922,5523921,5523919,5499017,5498999,5498973,5288413,5141489,5141416,4443847,4443808,4443793,4149852,4149831,4149825,4149821,4149813,4149671,4149667,4149639,4149631,4149627,4149620,4149611,4149600,4149550,4001977,3978496,3978442,3978440,3978151,3978092,3977796,3852712,3700715,3700589,3621943,3621859,3621679,3603143,3603063,3555964";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/dsouthern/images";break}switch(a){case 1:b="http://www1.clikpic.com/dsouthern/images";break}switch(a){case 2:b="http://admin.clikpic.com/dsouthern/images";break}switch(a){case 24:b="http://tpc15/clikpic/dsouthern/images";break}switch(a){case 4:b="http://www.clikchurch.com/dsouthern/images";break}switch(a){case 5:b="http://www2.clikpic.com/dsouthern/images";break}switch(a){case 22:b="http://tpc5/clikpic/dsouthern/images";break}switch(a){case 23:b="http://tpc10/clikpic/dsouthern/images";break}switch(a){case 25:b="http://tpc16/clikpic/dsouthern/images";break}switch(a){case 15:b="http://www3.clikpic.com/dsouthern/images";break}switch(a){case 18:b="http://www4.clikpic.com/dsouthern/images";break}switch(a){case 19:b="http://www5.clikpic.com/dsouthern/images";break}switch(a){case 31:b="http://www7.clikpic.com/dsouthern/images";break}switch(a){case 32:b="http://admin2.clikpic.com/dsouthern/images";break}switch(a){case 33:b="http://www8.clikpic.com/dsouthern/images";break}switch(a){case 34:b="http://www9.clikpic.com/dsouthern/images";break}switch(a){case 35:b="http://admin3.clikpic.com/dsouthern/images";break}switch(a){case 37:b="http://admin4.clikpic.com/dsouthern/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="'+escape(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="Southern 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+'")'})}}};