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[4423968]=new thumbnail(4423968,"198088","Always have fun!!!!!!!","DSC_0150_edit_thumb.jpg",130,87,1);thumbnails[4584922]=new thumbnail(4584922,"198088","Summer and Storm ","02290825-Horses-5_thumb.JPG",130,87,1);thumbnails[4585201]=new thumbnail(4585201,"198088","Glen Bruar Dunvegan doing well down south","HiPo063_thumb.jpg",130,87,1);thumbnails[5339122]=new thumbnail(5339122,"198088","Snowy New Year 2010","Edited_1_thumb.JPG",130,87,1);thumbnails[5339128]=new thumbnail(5339128,"198088","Storm and Katrine","Edited_3_thumb.JPG",130,87,1);thumbnails[5339130]=new thumbnail(5339130,"198088","Feeding time","Edited_4_thumb.JPG",130,87,1);thumbnails[5339142]=new thumbnail(5339142,"198088","Storm and Summer","Edited_7_thumb.JPG",130,195,1);thumbnails[5339149]=new thumbnail(5339149,"198088","","Edited_9_thumb.JPG",130,87,1);thumbnails[5339152]=new thumbnail(5339152,"198088","","Edited_10_thumb.JPG",130,87,1);thumbnails[5339157]=new thumbnail(5339157,"198088","","Edited_15_thumb.JPG",130,195,1);thumbnails[5339163]=new thumbnail(5339163,"198088","","Edited_12_thumb.JPG",130,195,1);thumbnails[5339167]=new thumbnail(5339167,"198088","","Edited_13_thumb.JPG",130,195,1);thumbnails[1009418]=new thumbnail(1009418,"139784","Glen Bruar Summer","Web 0017_thumb.jpg",130,195,1);thumbnails[4584751]=new thumbnail(4584751,"139784","Summer -August 2009","02290825-Horses-7_thumb.JPG",130,87,1);thumbnails[4584758]=new thumbnail(4584758,"139784","Summer","02290825-Horses-8_thumb.JPG",130,87,1);thumbnails[5311005]=new thumbnail(5311005,"139784","","Web_Image_5_thumb.JPG",130,87,1);thumbnails[5471613]=new thumbnail(5471613,"139784","Storm","DSC_0062_thumb.JPG",130,195,1);thumbnails[2183481]=new thumbnail(2183481,"135836","Strathisla Riding Club Show","glenb1 web_thumb.jpg",130,87,1);thumbnails[3031881]=new thumbnail(3031881,"135836","Misty 1st and Reserve Champion.","DSC_0092 web_thumb.jpg",130,87,1);thumbnails[4770000]=new thumbnail(4770000,"135836","Black Isle","th_Nikon51-1_thumb.jpg",130,141,1);thumbnails[5311001]=new thumbnail(5311001,"135836","","Web_Image_4_thumb.JPG",130,87,1);thumbnails[5311014]=new thumbnail(5311014,"135836","","Web_Image_9_thumb.JPG",130,87,1);thumbnails[5395896]=new thumbnail(5395896,"135836","Misty - January2020","18012010046_thumb.jpg",130,98,1);thumbnails[5471627]=new thumbnail(5471627,"135836","Misty - Feb 2010","DSC_0116_edit_thumb.jpg",130,87,1);thumbnails[2204264]=new thumbnail(2204264,"135837","My girl!!","chime_pic_sfcs_(3)_thumb.jpg",130,107,1);thumbnails[2204365]=new thumbnail(2204365,"135837","Proud Mum!","m379 web-site_thumb.jpg",130,195,1);thumbnails[2359034]=new thumbnail(2359034,"135837","This is 'normal' Chime!!!","RHS Day 4 (193)_thumb.JPG",130,87,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[4258440]=new thumbnail(4258440,"135837","RHS 2009 - 2nd place in 2 yo class","PBCHIME_thumb.jpg",130,98,1);thumbnails[4258463]=new thumbnail(4258463,"135837","RHS 2009","PBChime2_thumb.jpg",130,98,1);thumbnails[4423916]=new thumbnail(4423916,"135837","Nairn ","DSC_0023_edit_thumb.jpg",130,87,1);thumbnails[4423971]=new thumbnail(4423971,"135837","Watching for every camera!!!","DSC_0070_edit_thumb.jpg",130,87,1);thumbnails[4584883]=new thumbnail(4584883,"135837","Happy in her field!!!!","02290825-Horses-2_thumb.JPG",130,87,1);thumbnails[4693960]=new thumbnail(4693960,"135837","RHS 2009","Royal_Highland_Show_2009_thumb.jpg",130,97,1);thumbnails[5471629]=new thumbnail(5471629,"135837","Chime - Feb 2010","DSC_0108_thumb.JPG",130,87,1);thumbnails[3547833]=new thumbnail(3547833,"136368","March 2009","20090308_web_15_thumb.JPG",130,87,1);thumbnails[3685149]=new thumbnail(3685149,"136368","Elgin Show - April 2009","PICT0046_thumb.jpg",130,86,1);thumbnails[3719110]=new thumbnail(3719110,"136368","ADWPCEG Spring Show","Modified_pic_thumb.jpg",130,125,1);thumbnails[4423967]=new thumbnail(4423967,"136368","Nairn Show 2009","DSC_0027_edit_thumb.jpg",130,87,1);thumbnails[4584891]=new thumbnail(4584891,"136368","Ella - August 2009","02290825-Horses-9_thumb.JPG",130,87,1);thumbnails[4693907]=new thumbnail(4693907,"136368","Champion!","Northern_Working_Horse_Society_2009_thumb.jpg",130,176,1);thumbnails[5471616]=new thumbnail(5471616,"136368","Feb 2010","DSC_0106_thumb.JPG",130,87,1);thumbnails[5471620]=new thumbnail(5471620,"136368","Ella - Feb 2010","DSC_0112_thumb.JPG",130,87,1);thumbnails[5310994]=new thumbnail(5310994,"192224","","Web_Image_1_thumb.JPG",130,87,1);thumbnails[5311007]=new thumbnail(5311007,"192224","","Web_Image_6_thumb.JPG",130,87,1);thumbnails[5311010]=new thumbnail(5311010,"192224","","Web_Image_7_thumb.JPG",130,195,1);thumbnails[4584731]=new thumbnail(4584731,"265571","Katrine of Stanford","02290825-Horses-4_thumb.JPG",130,87,1);thumbnails[5492203]=new thumbnail(5492203,"265571","","DSC_0114_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[3144890]=new thumbnail(3144890,"51436","Glen Bruar Summer Thyme","291108 (55) web_thumb.jpg",130,195,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[2101361]=new thumbnail(2101361,"140038","Bridles - handmade by excellent saddler","Bridle 1_thumb.jpg",130,195,1);thumbnails[2101366]=new thumbnail(2101366,"140038","Bridles - the older more traditional style.","Bridle 2_thumb.jpg",130,195,1);thumbnails[4585004]=new thumbnail(4585004,"140038","Glen Bruar Summer Storm","02290825-Horses-101_thumb.JPG",130,87,1);thumbnails[5492205]=new thumbnail(5492205,"140038","Katrine","DSC_01141_thumb.JPG",130,87,1);thumbnails[5492210]=new thumbnail(5492210,"140038","","DSC_0126_thumb.JPG",130,87,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[198088]=new gallery(198088,"5339167,5339163,5339157,5339152,5339149,5339142,5339130,5339128,5339122,4585201","A day in the life of .........","gallery",[4423968,4584922,4585201,5339122,5339128,5339130,5339142,5339149,5339152,5339157,5339163,5339167]);galleries[139784]=new gallery(139784,"5471613,5311005,4584758,4584751,1009418","Glen Bruar Summer","gallery",[1009418,4584751,4584758,5311005,5471613]);galleries[135836]=new gallery(135836,"5471627,5395896,5311014,5311001,4770000,3031881,2183481","Thea of Sherrifmuir (Misty)","gallery",[2183481,3031881,4770000,5311001,5311014,5395896,5471627]);galleries[135837]=new gallery(135837,"4258440,2612167","Lochlands Silver Chime","gallery",[2204264,2204365,2359034,2612167,3146530,4258440,4258463,4423916,4423971,4584883,4693960,5471629]);galleries[136368]=new gallery(136368,"5471620,5471616,4693907,4584891,4423967,3719110,3685149,3547833","Ella of Craignetherty","gallery",[3547833,3685149,3719110,4423967,4584891,4693907,5471616,5471620]);galleries[192224]=new gallery(192224,"5311010,5311007,5310994","Achnacone Bruar's Pride","gallery",[5310994,5311007,5311010]);galleries[265571]=new gallery(265571,"5492203,4584731","Katrine of Stanford","gallery",[4584731,5492203]);galleries[62475]=new gallery(62475,"","Stallions","gallery",[]);galleries[71734]=new gallery(71734,"","Foals","gallery",[]);galleries[51436]=new gallery(51436,"3144890,1358299,834613,675618,675606,675605,675601,675494,675493","Ponies owned and bred","gallery",[1358299,675493,675494,675601,675605,675606,675618,834613,3144890]);galleries[51439]=new gallery(51439,"1493782,893228,685221,675609,675603,675499,675495","Golden Oldies","gallery",[675495,675499,675603,675609,685221,893228,1493782]);galleries[275541]=new gallery(275541,"","For HIRE and TUITION","gallery",[]);galleries[140038]=new gallery(140038,"5492210,5492205,4585004,2101366,2101361","For Sale","gallery",[2101361,2101366,4585004,5492205,5492210]);galleries[178261]=new gallery(178261,"4584743,3264216,3031891,3031877,3031868","The Hobbits","gallery",[3031868,3031877,3031891,3264216,4584743]);var imageSets=new Object();imageSets[1]="5471627,5471620,5471616,5395896,5339142,5339130,5339122,5311014,5310994,4693960,4584891,4584758,4423967,4423916,4258463,4258440,3719110,893228";imageSets[2]="4258440,2612167";imageSets[3]="4770000,4693960,4693907,4258463,4258440";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}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="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({centre:true});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+'")'})}}};