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[2140681]=new thumbnail(2140681,"","","NC website_thumb.jpg",130,173,1);thumbnails[3851725]=new thumbnail(3851725,"","","Home_page_graphic123_thumb.jpg",130,99,1);thumbnails[3851776]=new thumbnail(3851776,"","","LLCALOGo_thumb1_1_thumb.jpg",130,183,1);thumbnails[3854123]=new thumbnail(3854123,"","","Web_Image_1_thumb.jpg",130,99,1);thumbnails[3854168]=new thumbnail(3854168,"","","Web_Image_2_thumb.jpg",130,99,1);thumbnails[3854254]=new thumbnail(3854254,"","","Web_Image_3_thumb.jpg",130,99,1);thumbnails[3854260]=new thumbnail(3854260,"","","Web_Image_4_thumb.jpg",130,99,1);thumbnails[3854278]=new thumbnail(3854278,"","","Web_Image_5_thumb.jpg",130,99,1);thumbnails[3854310]=new thumbnail(3854310,"","","Web_Image_6_thumb.jpg",130,99,1);thumbnails[3854313]=new thumbnail(3854313,"","","Web_Image_7_thumb.jpg",130,99,1);thumbnails[3854322]=new thumbnail(3854322,"","","Web_Image_8_thumb.jpg",130,99,1);thumbnails[976895]=new thumbnail(976895,"18828","Urquhart Castle","IOS0034_web_thumb.jpg",130,87,1);thumbnails[643146]=new thumbnail(643146,"18828","Eilean Donan Castle","IOS0002_web_thumb.jpg",130,84,1);thumbnails[207336]=new thumbnail(207336,"18828","Eilean Donan Castle","IOS0003_web_thumb.jpg",130,87,1);thumbnails[1400723]=new thumbnail(1400723,"18828","Castle Campbell","IOS0018_web_thumb.jpg",130,87,1);thumbnails[565493]=new thumbnail(565493,"18828","The Pineapple","IOS0021_web_thumb.jpg",130,85,1);thumbnails[207199]=new thumbnail(207199,"18828","Eilean Donan Castle","IOS0001_web_thumb.jpg",130,87,1);thumbnails[207879]=new thumbnail(207879,"18828","Stirling Castle","IOS0007_web_thumb.jpg",130,86,1);thumbnails[1708644]=new thumbnail(1708644,"18828","Eilean Donan Castle","IOS0022_web_thumb.jpg",130,87,1);thumbnails[1708662]=new thumbnail(1708662,"18828","Stirling Castle","IOS0032_web_thumb.jpg",130,84,1);thumbnails[976894]=new thumbnail(976894,"18828","Castle Stalker","IOS0031_web_thumb.jpg",130,90,1);thumbnails[2420839]=new thumbnail(2420839,"18828","Kilchurn Castle","IOS0045_web_thumb.jpg",130,87,1);thumbnails[565478]=new thumbnail(565478,"18828","The Pineapple","Pineapple 1_thumb.jpg",130,198,1);thumbnails[1790996]=new thumbnail(1790996,"18828","Castle Campbell","Castle Campbell b&w_thumb.jpg",130,198,1);thumbnails[2444502]=new thumbnail(2444502,"18828","Stirling Castle Cannon","IOS0082_thumb.jpg",130,195,1);thumbnails[2444515]=new thumbnail(2444515,"18828","Castle Stalker","IOS0083_thumb.jpg",130,195,1);thumbnails[2444801]=new thumbnail(2444801,"18828","Stirling Castle","IOS0084_thumb.jpg",130,195,1);thumbnails[664482]=new thumbnail(664482,"18898","Forth Road Bridge","IOS0016_web_thumb.jpg",130,86,1);thumbnails[737728]=new thumbnail(737728,"18898","Wallace Monument","IOS0014_web_thumb.jpg",130,84,1);thumbnails[833999]=new thumbnail(833999,"18898","Wallace Monument","IOS0015_web_thumb.jpg",130,86,1);thumbnails[834004]=new thumbnail(834004,"18898","Tullibardine Chapel","IOS0026_web_thumb.jpg",130,87,1);thumbnails[868751]=new thumbnail(868751,"18898","Wallace Monument","IOS0012_web_thumb.jpg",130,86,1);thumbnails[1400671]=new thumbnail(1400671,"18898","Clyde View","Glasgow 1_thumb.jpg",130,84,1);thumbnails[1400676]=new thumbnail(1400676,"18898","Science Centre","IOS0037_web_thumb.jpg",130,87,1);thumbnails[207353]=new thumbnail(207353,"18898","Forth Bridge","IOS0006_web_thumb.jpg",130,87,1);thumbnails[249374]=new thumbnail(249374,"18898","Wallace Monument","IOS0010_web_thumb.jpg",130,86,1);thumbnails[227126]=new thumbnail(227126,"18898","Wallace Monument","IOS0011_web_thumb.jpg",130,87,1);thumbnails[207853]=new thumbnail(207853,"18898","Wallace Monument","IOS0013_web_thumb.jpg",130,86,1);thumbnails[976896]=new thumbnail(976896,"18898","Tarbert Ness","tarbertness lighthouse lighter_thumb.small.jpg",130,197,1);thumbnails[1721175]=new thumbnail(1721175,"18898","Wallace Monument","IOS0063_web_thumb.jpg",130,201,1);thumbnails[1721186]=new thumbnail(1721186,"18898","Finnieston Crane","IOS0065_web_thumb.jpg",130,199,1);thumbnails[1721196]=new thumbnail(1721196,"18898","Wallace Monument","Wallace black & white portrait_thumb.jpg",130,198,1);thumbnails[1605030]=new thumbnail(1605030,"18924","Kinnoull Tower View   ","IOS0040_web_thumb.jpg",130,87,1);thumbnails[1605400]=new thumbnail(1605400,"18924","Kinnoull Tower View","IOS0042_web_thumb.jpg",130,87,1);thumbnails[1791009]=new thumbnail(1791009,"18924","Glenshee Snow","IOS0044_web_thumb.jpg",130,87,1);thumbnails[207685]=new thumbnail(207685,"18924","Loch Lomond Sunrise","IOS0004_web_thumb.jpg",130,86,1);thumbnails[883079]=new thumbnail(883079,"18924","Stirling View","IOS0028_web_thumb.jpg",130,87,1);thumbnails[207864]=new thumbnail(207864,"18924","Loch Lomond Sunrise","IOS0035_web_thumb.jpg",130,86,1);thumbnails[882983]=new thumbnail(882983,"18924","Black Rock Cottage","IOS0030_web_thumb.jpg",130,87,1);thumbnails[207884]=new thumbnail(207884,"18924","Milarrochy Rocks","IOS0020_web_thumb.jpg",130,86,1);thumbnails[883003]=new thumbnail(883003,"18924","Rannoch Moor","IOS0029_web_thumb.jpg",130,87,1);thumbnails[207710]=new thumbnail(207710,"18924","Lonbain Beach","IOS0023_web_thumb.jpg",130,85,1);thumbnails[207894]=new thumbnail(207894,"18924","Shieldaig","IOS0019_web_thumb.jpg",130,87,1);thumbnails[834001]=new thumbnail(834001,"18924","Loch view","IOS0027_web_thumb.jpg",130,87,1);thumbnails[883138]=new thumbnail(883138,"18924","Loch Monzievaird","IOS0025_web_thumb.jpg",130,97,1);thumbnails[539566]=new thumbnail(539566,"18924","Bracklin Falls","IOS0024_web_thumb.jpg",130,87,1);thumbnails[1605089]=new thumbnail(1605089,"18924","Kinnoull Hill View","IOS0041_web_thumb.jpg",130,87,1);thumbnails[1721102]=new thumbnail(1721102,"18924","Rannoch Moor","IOS0036_web_thumb.jpg",130,87,1);thumbnails[1721127]=new thumbnail(1721127,"18924","Falls of Dochart","IOS0038_web_thumb.jpg",130,92,1);thumbnails[2420853]=new thumbnail(2420853,"18924","Loch Creran","IOS0046_web_thumb.jpg",130,87,1);thumbnails[1214140]=new thumbnail(1214140,"18924","Whisky Barrels","IOS0009_web_thumb.jpg",130,87,1);thumbnails[2420885]=new thumbnail(2420885,"18924","Tigh-an-Truish Inn, Seil","IOS0047_web_thumb.jpg",130,87,1);thumbnails[209733]=new thumbnail(209733,"18924","Ochil View","Ochil View_thumb.jpg",130,195,1);thumbnails[1790668]=new thumbnail(1790668,"18924","Glenshee Fence","Glenshee Fence_thumb.jpg",130,195,1);thumbnails[209731]=new thumbnail(209731,"18924","Inchfad Island","IOS0061_web_thumb.jpg",130,178,1);thumbnails[1721143]=new thumbnail(1721143,"18924","Kinnoull View","IOS0062_web_thumb.jpg",130,195,1);thumbnails[1721201]=new thumbnail(1721201,"18924","Kinnoull Tower View","Kinnoull View Sepia_thumb.jpg",130,195,1);thumbnails[2420972]=new thumbnail(2420972,"18924","Benderloch Stones","Benderloch Stones_thumb.jpg",130,173,1);thumbnails[976884]=new thumbnail(976884,"18924","Loch Lomond Sunrise","IMG_1204_thumb.small.jpg",130,196,1);thumbnails[2421004]=new thumbnail(2421004,"18924","Braes of Doune","Wind Turbines_thumb.jpg",130,195,1);thumbnails[2421022]=new thumbnail(2421022,"18924","Lady's Tower, Elie","Ladys Tower at Ruby Bay_thumb.jpg",130,195,1);thumbnails[2421036]=new thumbnail(2421036,"18924","St Andrews Cathedral","St Andrews Catherdral_thumb.jpg",130,200,1);thumbnails[2421045]=new thumbnail(2421045,"18924","Loch Fyne","Loch Fyne_thumb.jpg",130,197,1);thumbnails[4445195]=new thumbnail(4445195,"18924","White Loch Fisherman","White_Loch_Fisherman_21_thumb.jpg",130,195,1);thumbnails[1214231]=new thumbnail(1214231,"37656","Channonry Dolphin","IOS0051_web_thumb.jpg",130,86,1);thumbnails[1790974]=new thumbnail(1790974,"37656","Thistle","IOS0043_web_thumb.jpg",130,87,1);thumbnails[4423099]=new thumbnail(4423099,"37656","Shetland Puffin","IOS0049_web_thumb.jpg",130,87,1);thumbnails[4483938]=new thumbnail(4483938,"37656","Shetland Seals","IOS0048_web_thumb.jpg",130,88,1);thumbnails[4483944]=new thumbnail(4483944,"37656","Shetland Seal","IOS0050_web1_thumb.jpg",130,87,1);thumbnails[480511]=new thumbnail(480511,"37656","Aberfeldy Red","IOS0005_web_thumb.jpg",130,82,1);thumbnails[976892]=new thumbnail(976892,"37656","Channonry Dolphins","IOS0008_web_thumb.jpg",130,89,1);thumbnails[2420951]=new thumbnail(2420951,"37656","Purple Posers","Purple posers_thumb.jpg",130,183,1);thumbnails[2416796]=new thumbnail(2416796,"37656","Braco Bluebells","Bluebells 1_thumb.jpg",130,195,1);thumbnails[4484068]=new thumbnail(4484068,"37656","Owl","IOS0088_web1_thumb.jpg",130,206,1);thumbnails[3115037]=new thumbnail(3115037,"37656","Owl Portrait","OWL PORTRAIT website_thumb.jpg",130,195,1);thumbnails[3115048]=new thumbnail(3115048,"37656","Autumn Glory","Autumn Leaves web_thumb.jpg",130,173,1);var galleries=new Object();galleries[18828]=new gallery(18828,"643146","Castles & Houses","gallery",[976895,643146,207336,1400723,565493,207199,207879,1708644,1708662,976894,2420839,565478,1790996,2444502,2444515,2444801]);galleries[18898]=new gallery(18898,"1400671","Landmarks","gallery",[664482,737728,833999,834004,868751,1400671,1400676,207353,249374,227126,207853,976896,1721175,1721186,1721196]);galleries[18924]=new gallery(18924,"1214140,207685","General","gallery",[1605030,1605400,1791009,207685,883079,207864,882983,207884,883003,207710,207894,834001,883138,539566,1605089,1721102,1721127,2420853,1214140,2420885,209733,1790668,209731,1721143,1721201,2420972,976884,2421004,2421022,2421036,2421045,4445195]);galleries[37656]=new gallery(37656,"1790974,976892,480511","Wildlife","gallery",[1214231,1790974,4423099,4483938,4483944,480511,976892,2420951,2416796,4484068,3115037,3115048]);var imageSets=new Object();imageSets[1]="3854322,3854313,3854310,3854278,3854260,3854254,3854168,3854123,3851725";imageSets[2]="1790974,1400671,1214140,976892,643146,480511,207685";imageSets[3]="4484068,4483944,4483938,4445195,4423099,3854322,3854313,3854310,3854278,3854260,3854254,3854168,3854123,3851776,3851725,3115048,3115037,2444801,2444515,2444502,2421045,2421036,2421022,2421004,2420972,2420951,2420885,2420853,2420839,2416796,2140681,1791009,1790996,1790974,1790668,1721201,1721196,1721186,1721175,1721143,1721127,1721102,1708662,1708644,1605400,1605089,1605030,1400723,1400676,1400671";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/noelyboy/images";break}switch(a){case 1:b="http://www1.clikpic.com/noelyboy/images";break}switch(a){case 2:b="http://admin.clikpic.com/noelyboy/images";break}switch(a){case 24:b="http://tpc15/clikpic/noelyboy/images";break}switch(a){case 4:b="http://www.clikchurch.com/noelyboy/images";break}switch(a){case 5:b="http://www2.clikpic.com/noelyboy/images";break}switch(a){case 22:b="http://tpc5/clikpic/noelyboy/images";break}switch(a){case 23:b="http://tpc10/clikpic/noelyboy/images";break}switch(a){case 25:b="http://tpc16/clikpic/noelyboy/images";break}switch(a){case 15:b="http://www3.clikpic.com/noelyboy/images";break}switch(a){case 18:b="http://www4.clikpic.com/noelyboy/images";break}switch(a){case 19:b="http://www5.clikpic.com/noelyboy/images";break}switch(a){case 31:b="http://www7.clikpic.com/noelyboy/images";break}switch(a){case 32:b="http://admin2.clikpic.com/noelyboy/images";break}switch(a){case 33:b="http://www8.clikpic.com/noelyboy/images";break}switch(a){case 34:b="http://www9.clikpic.com/noelyboy/images";break}switch(a){case 35:b="http://admin3.clikpic.com/noelyboy/images";break}switch(a){case 37:b="http://admin4.clikpic.com/noelyboy/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=" Images of Scotland";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("Items added to Trolley").show()}else{$("#paymentConfirm").text("Items added to Trolley").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><br>Purchase 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><br>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><br>Order this print online using Paypal:</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="NOELYBOY">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Purchase         " id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="See Trolley" 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">Items added to Trolley</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+'")'})}}};