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[5112384]=new thumbnail(5112384,"288962","Sand","IMG_8637_thumb.jpg",130,195,5);thumbnails[5112386]=new thumbnail(5112386,"288962","Waves Departed","IMG_8641_thumb.jpg",130,87,5);thumbnails[5117315]=new thumbnail(5117315,"288962","Ship and Cloud","IMG_9447_thumb.jpg",130,195,5);thumbnails[5117376]=new thumbnail(5117376,"288962","Aberdeen Beach","IMG_13952_thumb.jpg",130,36,5);thumbnails[5114226]=new thumbnail(5114226,"288962","Sunset","sollerportpano_thumb.jpg",130,59,5);thumbnails[5114216]=new thumbnail(5114216,"288962","Bay and Clouds 1","sollerportcloudsunset1_thumb.jpg",130,195,5);thumbnails[5114223]=new thumbnail(5114223,"288962","Bay and Clouds 2","sollerportcloudsunset3_thumb.jpg",130,195,5);thumbnails[5114220]=new thumbnail(5114220,"288962","Bay and Clouds 3","sollerportcloudsunset2_thumb.jpg",130,87,5);thumbnails[5114218]=new thumbnail(5114218,"288962","Bay and Clouds mono","sollerportcloudsunset2-2_thumb.jpg",130,87,5);thumbnails[5112370]=new thumbnail(5112370,"288962","Tines","IMG_0992_thumb.jpg",130,87,5);thumbnails[5112342]=new thumbnail(5112342,"288962","Creels","creelscove_thumb.jpg",130,97,5);thumbnails[5112390]=new thumbnail(5112390,"288962","Dawn Flight","IMG_9357_thumb.jpg",130,87,5);thumbnails[5116241]=new thumbnail(5116241,"288962","Roses in the water","IMG_4286_thumb.jpg",130,87,5);thumbnails[5112388]=new thumbnail(5112388,"288962","Morning","IMG_9356_thumb.jpg",130,87,5);thumbnails[5114237]=new thumbnail(5114237,"288962","Stonehaven Harbour","stoneysundialharbour_thumb.jpg",130,80,5);thumbnails[5112341]=new thumbnail(5112341,"288963","Cove","coveboats1_thumb.jpg",130,97,5);thumbnails[5112343]=new thumbnail(5112343,"288963","Dunnotar Castle","dunnottar2_thumb.jpg",130,195,5);thumbnails[5112344]=new thumbnail(5112344,"288963","Steeple and Jacks","Image108_thumb.jpg",130,137,5);thumbnails[5112345]=new thumbnail(5112345,"288963","Modern","Image109_thumb.jpg",130,124,5);thumbnails[5112346]=new thumbnail(5112346,"288963","Art Gallery","IMG_0100_thumb.jpg",130,173,5);thumbnails[5112363]=new thumbnail(5112363,"288963","Steeple","IMG_0558_thumb.jpg",130,195,5);thumbnails[5112375]=new thumbnail(5112375,"288963","Memorial Lamp","IMG_4275_thumb.jpg",130,195,5);thumbnails[5112377]=new thumbnail(5112377,"288963","Churches","IMG_4282_thumb.jpg",130,195,5);thumbnails[5114137]=new thumbnail(5114137,"288963","Ben Lomond","benlomondfar_thumb.jpg",130,87,5);thumbnails[5114140]=new thumbnail(5114140,"288963","Cottage","cottagelussglendarroch_thumb.jpg",130,87,5);thumbnails[5114180]=new thumbnail(5114180,"288963","Maiden Stone front","IMG_1079_thumb.jpg",130,195,5);thumbnails[5114182]=new thumbnail(5114182,"288963","Maiden Stone rear","IMG_1085_thumb.jpg",130,195,5);thumbnails[5114194]=new thumbnail(5114194,"288963","Castlerigg","IMG_1312_thumb.jpg",130,36,5);thumbnails[5114195]=new thumbnail(5114195,"288963","Carriage/Shed","IMG_1325_thumb.jpg",130,87,5);thumbnails[5114204]=new thumbnail(5114204,"288963","Castlerigg 1","IMG_9335_thumb.jpg",130,195,5);thumbnails[5114205]=new thumbnail(5114205,"288963","Castlerigg 2","IMG_9345_thumb.jpg",130,195,5);thumbnails[5114206]=new thumbnail(5114206,"288963","Muick","IMG_9576_thumb.jpg",130,87,5);thumbnails[5114213]=new thumbnail(5114213,"288963","Scarves","scarvessoller_thumb.jpg",130,87,5);thumbnails[5114225]=new thumbnail(5114225,"288963","Lightning","sollerportlightning1_thumb.jpg",130,87,5);thumbnails[5114232]=new thumbnail(5114232,"288963","Poppies","stoneyflowers2_thumb.jpg",130,195,5);thumbnails[5116393]=new thumbnail(5116393,"288963","Misty Dee Valley","deevalleymist_thumb.jpg",130,80,5);thumbnails[5116395]=new thumbnail(5116395,"288963","Union Street, Aberdeen","IMG_0054_thumb.jpg",130,173,5);thumbnails[5117317]=new thumbnail(5117317,"288963","Dogs","IMG_8465_thumb.jpg",130,87,5);thumbnails[5117375]=new thumbnail(5117375,"288963","Bridge of Don, Aberdeen","IMG_12503_thumb.jpg",130,51,5);thumbnails[5114198]=new thumbnail(5114198,"288963","Doves","IMG_9044_thumb.jpg",130,87,5);thumbnails[5112392]=new thumbnail(5112392,"288927","Fun","IMG_9363_thumb.jpg",130,87,5);thumbnails[5114184]=new thumbnail(5114184,"288927","Kite 1","IMG_1245_thumb.jpg",130,195,5);thumbnails[5114185]=new thumbnail(5114185,"288927","Kite 2","IMG_1246_thumb.jpg",130,87,5);thumbnails[5114192]=new thumbnail(5114192,"288927","Chris","IMG_1256_thumb.jpg",130,195,5);thumbnails[5114210]=new thumbnail(5114210,"288927","Talk","oldmenhc_thumb.jpg",130,87,5);thumbnails[5114230]=new thumbnail(5114230,"288927","Smoke","steamfairsmoke_thumb.jpg",130,87,5);thumbnails[5116394]=new thumbnail(5116394,"288927","Aberdeen","IMG_0047_thumb.jpg",130,98,5);thumbnails[5116397]=new thumbnail(5116397,"288927","Piper Alpha Memorial","IMG_0501_thumb.jpg",130,195,5);thumbnails[5116399]=new thumbnail(5116399,"288927","Piper Alpha Memorial Detail","IMG_4224_thumb.jpg",130,195,5);thumbnails[5116400]=new thumbnail(5116400,"288927","Piper Alpha Memorial Detail 2","IMG_4233_thumb.jpg",130,87,5);thumbnails[5116434]=new thumbnail(5116434,"288927","At The Games","IMG_8771_thumb.jpg",130,195,5);thumbnails[5116514]=new thumbnail(5116514,"288927","Effort","IMG_8958_thumb.jpg",130,87,5);thumbnails[5116566]=new thumbnail(5116566,"288927","Man Walking Past a Window","IMG_9180_thumb.jpg",130,87,5);thumbnails[5116567]=new thumbnail(5116567,"288927","Sharpening","stuhands_thumb.jpg",130,87,5);thumbnails[5116398]=new thumbnail(5116398,"288927","Clare","IMG_1095_thumb.jpg",130,183,5);thumbnails[5116477]=new thumbnail(5116477,"288927","Fascination","IMG_8800_thumb.jpg",130,87,5);thumbnails[5114138]=new thumbnail(5114138,"288927","Lion","chineselion_thumb.jpg",130,87,5);thumbnails[5114209]=new thumbnail(5114209,"288927","monk","monkback_thumb.jpg",130,85,5);thumbnails[5117319]=new thumbnail(5117319,"289095","Teasels","IMG_9440_thumb.jpg",130,195,5);thumbnails[5112373]=new thumbnail(5112373,"289095","Spines","IMG_1176_thumb.jpg",130,87,5);thumbnails[5114178]=new thumbnail(5114178,"289095","Leaf","IMG_08061_thumb.jpg",130,195,5);thumbnails[5112369]=new thumbnail(5112369,"289095","Leaf","IMG_0806_thumb.jpg",130,195,5);thumbnails[5112380]=new thumbnail(5112380,"289095","Heart of Stone","IMG_4353_thumb.jpg",130,87,5);thumbnails[5114146]=new thumbnail(5114146,"289095","Lily Recumbent","IMG_0584_thumb.jpg",130,195,5);thumbnails[5112366]=new thumbnail(5112366,"289095","Lily 1","IMG_0627_thumb.jpg",130,195,5);thumbnails[5114156]=new thumbnail(5114156,"289095","Lily 2","IMG_0628_thumb.jpg",130,195,5);thumbnails[5112365]=new thumbnail(5112365,"289095","Lily 3","IMG_0620_thumb.jpg",130,135,5);thumbnails[5114150]=new thumbnail(5114150,"289095","Lily 4","IMG_0609_thumb.jpg",130,123,5);thumbnails[5114147]=new thumbnail(5114147,"289095","lily 5","IMG_0586_thumb.jpg",130,87,5);thumbnails[5114154]=new thumbnail(5114154,"289095","Lily 6","IMG_0623_thumb.jpg",130,92,5);thumbnails[5114157]=new thumbnail(5114157,"289095","Roses","IMG_0687_thumb.jpg",130,87,5);thumbnails[5114158]=new thumbnail(5114158,"289095","Rose","IMG_0689_thumb.jpg",130,131,5);thumbnails[5114172]=new thumbnail(5114172,"289095","Lilies","IMG_0704_thumb.jpg",130,87,5);thumbnails[5114176]=new thumbnail(5114176,"289095","Stamen 2","IMG_0717_thumb.jpg",130,87,5);thumbnails[5114168]=new thumbnail(5114168,"289095","Stamen","IMG_0702_thumb.jpg",130,195,5);var galleries=new Object();galleries[288962]=new gallery(288962,"5114216","Sea","gallery",[5112384,5112386,5117315,5117376,5114226,5114216,5114223,5114220,5114218,5112370,5112342,5112390,5116241,5112388,5114237]);galleries[288963]=new gallery(288963,"5114205,5112363","Landscape","gallery",[5112341,5112343,5112344,5112345,5112346,5112363,5112375,5112377,5114137,5114140,5114180,5114182,5114194,5114195,5114204,5114205,5114206,5114213,5114225,5114232,5116393,5116395,5117317,5117375,5114198]);galleries[288927]=new gallery(288927,"5114192","People","gallery",[5112392,5114184,5114185,5114192,5114210,5114230,5116394,5116397,5116399,5116400,5116434,5116514,5116566,5116567,5116398,5116477,5114138,5114209]);galleries[289095]=new gallery(289095,"5114178","Close","gallery",[5117319,5112373,5114178,5112369,5112380,5114146,5112366,5114156,5112365,5114150,5114147,5114154,5114157,5114158,5114172,5114176,5114168]);var imageSets=new Object();imageSets[1]="5117376,5117375,5117319,5117317,5117315,5116567,5116566,5116514,5116477,5116434,5116400,5116399,5116398,5116397,5116395,5116394,5116393,5116241,5114237,5114232,5114230,5114226,5114225,5114223,5114220,5114218,5114216,5114213,5114210,5114209,5114206,5114205,5114204,5114198,5114195,5114194,5114192,5114185,5114184,5114182,5114180,5114178,5114176,5114172,5114168,5114158,5114157,5114156,5114154,5114150";imageSets[2]="5114216,5114205,5114192,5114178,5112363";imageSets[3]="5117376,5117375,5117319,5117317,5117315,5116567,5116566,5116514,5116477,5116434,5116400,5116399,5116398,5116397,5116395,5116394,5116393,5116241,5114237,5114232,5114230,5114226,5114225,5114223,5114220,5114218,5114216,5114213,5114210,5114209,5114206,5114205,5114204,5114198,5114195,5114194,5114192,5114185,5114184,5114182,5114180,5114178,5114176,5114172,5114168,5114158,5114157,5114156,5114154,5114150";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/nickshep/images";break}switch(a){case 1:b="http://www1.clikpic.com/nickshep/images";break}switch(a){case 2:b="http://admin.clikpic.com/nickshep/images";break}switch(a){case 24:b="http://tpc15/clikpic/nickshep/images";break}switch(a){case 4:b="http://www.clikchurch.com/nickshep/images";break}switch(a){case 5:b="http://www2.clikpic.com/nickshep/images";break}switch(a){case 22:b="http://tpc5/clikpic/nickshep/images";break}switch(a){case 23:b="http://tpc10/clikpic/nickshep/images";break}switch(a){case 25:b="http://tpc16/clikpic/nickshep/images";break}switch(a){case 15:b="http://www3.clikpic.com/nickshep/images";break}switch(a){case 18:b="http://www4.clikpic.com/nickshep/images";break}switch(a){case 19:b="http://www5.clikpic.com/nickshep/images";break}switch(a){case 31:b="http://www7.clikpic.com/nickshep/images";break}switch(a){case 32:b="http://admin2.clikpic.com/nickshep/images";break}switch(a){case 33:b="http://www8.clikpic.com/nickshep/images";break}switch(a){case 34:b="http://www9.clikpic.com/nickshep/images";break}switch(a){case 35:b="http://admin3.clikpic.com/nickshep/images";break}switch(a){case 37:b="http://admin4.clikpic.com/nickshep/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="Nick Shepherd 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+'")'})}}};