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[675590]=new thumbnail(675590,"","Glen Bruar","010_thumb.jpg",130,87,1);thumbnails[2101361]=new thumbnail(2101361,"331285","Bridles - handmade by excellent saddler","Bridle 1_thumb.jpg",130,195,1);thumbnails[2101366]=new thumbnail(2101366,"331285","Bridles - the older more traditional style.","Bridle 2_thumb.jpg",130,195,1);thumbnails[3719110]=new thumbnail(3719110,"","ADWPCEG Spring Show","Modified_pic_thumb.jpg",130,125,1);thumbnails[4585201]=new thumbnail(4585201,"320887","Glen Bruar Dunvegan doing well down south","HiPo063_thumb.jpg",130,87,1);thumbnails[5771247]=new thumbnail(5771247,"320887","Jess arrives...........","20100407_13_web_DF228D84-1EC9-D45B-1C17D0179F68DE64_thumb.JPG",130,195,1);thumbnails[6301823]=new thumbnail(6301823,"320896","Winner of 3yo filly class Royal Highland Show 2010","Day1122_thumb.jpg",130,84,1);thumbnails[6461926]=new thumbnail(6461926,"320896","Nairn Show 2010 - Champion<br>\r\n<br>\r\nLochlands Silver Chime","DSC_0104_thumb.JPG",130,87,1);thumbnails[6461952]=new thumbnail(6461952,"320896","Misty and Jess at Nairn Show","DSC_0004_thumb.JPG",130,87,1);thumbnails[2183481]=new thumbnail(2183481,"135836","Strathisla Riding Club Show","glenb1 web_thumb.jpg",130,87,1);thumbnails[5311001]=new thumbnail(5311001,"135836","","Web_Image_4_thumb.JPG",130,87,1);thumbnails[5395896]=new thumbnail(5395896,"135836","Misty - January 2010","18012010046_thumb.jpg",130,98,1);thumbnails[5471627]=new thumbnail(5471627,"135836","Misty - Feb 2010","DSC_0116_edit_thumb.jpg",130,87,1);thumbnails[5811763]=new thumbnail(5811763,"326504","","Foal_PS6_thumb.JPG",130,130,1);thumbnails[6461984]=new thumbnail(6461984,"326504","Misty and Jess","DSC_0086_thumb.JPG",130,116,1);thumbnails[6552214]=new thumbnail(6552214,"326504","","DSC_0141_thumb.JPG",130,87,1);thumbnails[6552220]=new thumbnail(6552220,"326504","","DSC_0143_thumb.JPG",130,87,1);thumbnails[6552221]=new thumbnail(6552221,"326504","","DSC_0145_thumb.JPG",130,87,1);thumbnails[6552223]=new thumbnail(6552223,"326504","","DSC_0155_thumb.JPG",130,87,1);thumbnails[2204264]=new thumbnail(2204264,"135837","My girl!!","chime_pic_sfcs_(3)_thumb.jpg",130,107,1);thumbnails[2612167]=new thumbnail(2612167,"135837","Chime is 1st at Keith Show","Keith Show (49)_thumb.JPG",130,87,1);thumbnails[3146530]=new thumbnail(3146530,"135837","","Lochlands_Silver_Chime_(2)_thumb.jpg",130,165,1);thumbnails[4423971]=new thumbnail(4423971,"135837","Champion Highland, Best Native and Reserve Overall - Nairn Show","DSC_0070_edit_thumb.jpg",130,87,1);thumbnails[4693960]=new thumbnail(4693960,"135837","RHS 2009","Royal_Highland_Show_2009_thumb.jpg",130,97,1);thumbnails[6301813]=new thumbnail(6301813,"135837","","th_Day179_thumb.jpg",130,142,1);thumbnails[6301814]=new thumbnail(6301814,"135837","","th_Day189-1_thumb.jpg",130,132,1);thumbnails[6301817]=new thumbnail(6301817,"135837","","Day171_thumb.jpg",130,87,1);thumbnails[6301818]=new thumbnail(6301818,"135837","","Day1121_thumb.jpg",130,88,1);thumbnails[5339122]=new thumbnail(5339122,"192224","Snowy New Year 2010","Edited_1_thumb.JPG",130,87,1);thumbnails[6549338]=new thumbnail(6549338,"192224","Lyradale Dexter","Dex_Aug1_thumb.jpg",130,98,1);thumbnails[6552180]=new thumbnail(6552180,"192224","August 2010 ","DSC_0011_thumb.JPG",130,87,1);thumbnails[6552181]=new thumbnail(6552181,"192224","","DSC_0031_thumb.JPG",130,87,1);thumbnails[6552183]=new thumbnail(6552183,"192224","","DSC_0038_thumb.JPG",130,87,1);thumbnails[6552184]=new thumbnail(6552184,"192224","","DSC_0036_thumb.JPG",130,87,1);thumbnails[6552185]=new thumbnail(6552185,"192224","","DSC_0056_thumb.JPG",130,87,1);thumbnails[6552186]=new thumbnail(6552186,"192224","","DSC_0098_thumb.JPG",130,87,1);thumbnails[6552188]=new thumbnail(6552188,"192224","","DSC_0117_thumb.JPG",130,87,1);thumbnails[6552190]=new thumbnail(6552190,"192224","","DSC_0121_thumb.JPG",130,87,1);thumbnails[6552192]=new thumbnail(6552192,"192224","","DSC_0077_thumb.JPG",130,87,1);thumbnails[6552196]=new thumbnail(6552196,"192224","","DSC_0115_thumb.JPG",130,87,1);thumbnails[6552199]=new thumbnail(6552199,"192224","","DSC_0123_thumb.JPG",130,195,1);thumbnails[6552228]=new thumbnail(6552228,"192224","","DSC_0078_thumb.JPG",130,87,1);thumbnails[6552533]=new thumbnail(6552533,"192224","","DSC_0018_thumb.JPG",130,87,1);thumbnails[6552585]=new thumbnail(6552585,"192224","","DSC_0089_thumb.JPG",130,87,1);thumbnails[1358299]=new thumbnail(1358299,"51436","Glen Bruar Misty Morn","Glenbruar Misty Morn 1991_thumb.jpg",130,195,1);thumbnails[675493]=new thumbnail(675493,"51436","Glen Bruar April","0011_thumb.jpg",130,130,1);thumbnails[675494]=new thumbnail(675494,"51436","Glen Bruar Dunvegan","002_thumb.jpg",130,101,1);thumbnails[675601]=new thumbnail(675601,"51436","Glen Bruar III in paniers","011_thumb.jpg",130,130,1);thumbnails[675605]=new thumbnail(675605,"51436","Glen Bruar III","013_thumb.jpg",130,87,1);thumbnails[675606]=new thumbnail(675606,"51436","Glen Bruar Findlay otherwise known as 'Budgie'","014_thumb.jpg",130,87,1);thumbnails[675618]=new thumbnail(675618,"51436","Glen Bruar Beinn Losgarnach","(24)_thumb.jpg",130,87,1);thumbnails[834613]=new thumbnail(834613,"51436","Glen Bruar Fern","glenbruarpic_thumb.jpg",130,100,1);thumbnails[1009418]=new thumbnail(1009418,"51436","Glen Bruar Summer","Web 0017_thumb.jpg",130,195,1);thumbnails[2359034]=new thumbnail(2359034,"198088","This is 'normal' Chime!!!","RHS Day 4 (193)_thumb.JPG",130,87,1);thumbnails[3144890]=new thumbnail(3144890,"51436","Glen Bruar Summer Thyme","291108 (55) web_thumb.jpg",130,195,1);thumbnails[4423968]=new thumbnail(4423968,"198088","Always have fun!!!!!!!","DSC_0150_edit_thumb.jpg",130,87,1);thumbnails[4693907]=new thumbnail(4693907,"51436","Champion and Reserve Overall - Northern Working Horse Show, Brodie Castle - Ella of Craignetherty","Northern_Working_Horse_Society_2009_thumb.jpg",130,176,1);thumbnails[6328233]=new thumbnail(6328233,"198088","First sit on.......","10072010436_thumb.jpg",130,98,1);thumbnails[6328334]=new thumbnail(6328334,"198088","First hack out!!!!!","12072010451_thumb.jpg",130,98,1);thumbnails[6328555]=new thumbnail(6328555,"198088","","10072010445_thumb.jpg",130,98,1);thumbnails[6552224]=new thumbnail(6552224,"198088","","DSC_0079_thumb.JPG",130,87,1);thumbnails[6552225]=new thumbnail(6552225,"198088","","DSC_0104_7BFCAAD9-1D09-001F-9928D42224D21372_thumb.JPG",130,87,1);thumbnails[6552227]=new thumbnail(6552227,"198088","","DSC_0106_thumb.JPG",130,87,1);thumbnails[675495]=new thumbnail(675495,"51439","Meggernie Maydew","003_thumb.jpg",130,87,1);thumbnails[675499]=new thumbnail(675499,"51439","Meggernie Maydew","007_thumb.jpg",130,195,1);thumbnails[675603]=new thumbnail(675603,"51439","Lorna of Invervack","012_thumb.jpg",130,120,1);thumbnails[675609]=new thumbnail(675609,"51439","Meggernie Maydew","016_thumb.jpg",130,87,1);thumbnails[685221]=new thumbnail(685221,"51439","Rose of Invervack","070105 (5)_thumb.JPG",130,87,1);thumbnails[893228]=new thumbnail(893228,"51439","Meggernie Maydew ","RHS WIN_thumb.jpg",130,87,1);thumbnails[1493782]=new thumbnail(1493782,"51439","Meggernie Maydew ","RHS 1992_thumb.jpg",130,195,1);thumbnails[3031868]=new thumbnail(3031868,"178261","Lucy and Daisy - Reserve Champion Young Handler November 2008","DSC_0088 web_thumb.jpg",130,195,1);thumbnails[3031877]=new thumbnail(3031877,"178261","Caitlin and a naughty Daisy","DSC_0063 web_thumb.jpg",130,87,1);thumbnails[3031891]=new thumbnail(3031891,"178261","Chuffed wee girl!!!!","DSC_0090 web_thumb.jpg",130,87,1);thumbnails[3264216]=new thumbnail(3264216,"178261","Dexter wins his big foal class","DSC_0126 web_thumb.jpg",130,87,1);thumbnails[4584743]=new thumbnail(4584743,"178261","Daisy - August 2009","02290825-Horses-1_thumb.JPG",130,87,1);var galleries=new Object();galleries[331285]=new gallery(331285,"2101366,2101361","For sale","section397023",[2101361,2101366]);galleries[320887]=new gallery(320887,"5771247,4585201","News","section384823",[4585201,5771247]);galleries[320896]=new gallery(320896,"6461952,6461926,6301823","Show results","section384834",[6301823,6461926,6461952]);galleries[135836]=new gallery(135836,"5471627,5395896,5311001,2183481","Thea of Sherrifmuir (Misty)","gallery",[2183481,5311001,5395896,5471627]);galleries[326504]=new gallery(326504,"6552223,6552221,6552220,6552214,6461984,5811763","Glen Bruar Genesis","gallery",[5811763,6461984,6552214,6552220,6552221,6552223]);galleries[135837]=new gallery(135837,"2612167","Lochlands Silver Chime","gallery",[2204264,2612167,3146530,4423971,4693960,6301813,6301814,6301817,6301818]);galleries[192224]=new gallery(192224,"6552585,6552533,6552228,6552199,6552196,6552192,6552190,6552188,6552186,6552185","Achnacone Bruar's Pride","section405557",[5339122,6549338,6552180,6552181,6552183,6552184,6552185,6552186,6552188,6552190,6552192,6552196,6552199,6552228,6552533,6552585]);galleries[198088]=new gallery(198088,"6552227,6552225,6552224,6328555,6328334,6328233,4423968,2359034","A day in the life of .........","gallery",[2359034,4423968,6328233,6328334,6328555,6552224,6552225,6552227]);galleries[51436]=new gallery(51436,"4693907,3144890,1358299,1009418,834613,675618,675606,675605,675601,675494","Ponies owned and bred","gallery",[1358299,675493,675494,675601,675605,675606,675618,834613,1009418,3144890,4693907]);galleries[51439]=new gallery(51439,"1493782,893228,685221,675609,675603,675499,675495","Golden Oldies","gallery",[675495,675499,675603,675609,685221,893228,1493782]);galleries[178261]=new gallery(178261,"4584743,3264216,3031891,3031877,3031868","The Hobbits","gallery",[3031868,3031877,3031891,3264216,4584743]);var imageSets=new Object();imageSets[1]="6552199,5811763,5471627,5395896,5339122,4693960,3719110,893228";imageSets[2]="2612167";imageSets[3]="6552199,4693960,4693907";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/glenbruar/images";break}switch(a){case 1:b="http://www1.clikpic.com/glenbruar/images";break}switch(a){case 2:b="http://admin.clikpic.com/glenbruar/images";break}switch(a){case 24:b="http://tpc15/clikpic/glenbruar/images";break}switch(a){case 4:b="http://www.clikchurch.com/glenbruar/images";break}switch(a){case 5:b="http://www2.clikpic.com/glenbruar/images";break}switch(a){case 22:b="http://tpc5/clikpic/glenbruar/images";break}switch(a){case 23:b="http://tpc10/clikpic/glenbruar/images";break}switch(a){case 25:b="http://tpc16/clikpic/glenbruar/images";break}switch(a){case 15:b="http://www3.clikpic.com/glenbruar/images";break}switch(a){case 18:b="http://www4.clikpic.com/glenbruar/images";break}switch(a){case 19:b="http://www5.clikpic.com/glenbruar/images";break}switch(a){case 31:b="http://www7.clikpic.com/glenbruar/images";break}switch(a){case 32:b="http://admin2.clikpic.com/glenbruar/images";break}switch(a){case 33:b="http://www8.clikpic.com/glenbruar/images";break}switch(a){case 34:b="http://www9.clikpic.com/glenbruar/images";break}switch(a){case 35:b="http://admin3.clikpic.com/glenbruar/images";break}switch(a){case 37:b="http://admin4.clikpic.com/glenbruar/images";break}switch(a){case 38:b="http://admin5.clikpic.com/glenbruar/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("section384823"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section384823.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("section384823"!=""){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="Glenbruar Highland Ponies: "+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;resizePhotoInfo();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(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}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+'")'})}}};