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[5735075]=new thumbnail(5735075,"326086","Beneath the Ice","2010-01-31_001_thumb.jpg",130,195,32);thumbnails[5740989]=new thumbnail(5740989,"326086","Frozen","2010-01-31_007_thumb.jpg",130,195,32);thumbnails[5740991]=new thumbnail(5740991,"326086","Geamhradh","2010-01-31_013_thumb.jpg",130,87,32);thumbnails[5740992]=new thumbnail(5740992,"326086","Highland Cathedral","2010-01-31_015_thumb.jpg",130,87,32);thumbnails[5740993]=new thumbnail(5740993,"326086","After the Freeze","2010-02-01_007_thumb.jpg",130,195,32);thumbnails[5740995]=new thumbnail(5740995,"326086","Snow","2010-02-01_014_thumb.jpg",130,195,32);thumbnails[5740996]=new thumbnail(5740996,"326086","Solas","2010-02-02_004_thumb.jpg",130,87,32);thumbnails[5740997]=new thumbnail(5740997,"326086","A Moment of Calm","2010-02-02_017_thumb.jpg",130,87,32);thumbnails[5740999]=new thumbnail(5740999,"326086","Beautiful Day","2010-02-02_032_thumb.jpg",130,87,32);thumbnails[5741001]=new thumbnail(5741001,"326086","Sunset over Tanera Mòr","2010-02-02_043_thumb.jpg",130,87,32);thumbnails[5741003]=new thumbnail(5741003,"326086","Hidden","2010-02-03_010_thumb.jpg",130,195,32);thumbnails[5741004]=new thumbnail(5741004,"326086","Abstract Ice","2010-02-03_028_thumb.jpg",130,195,32);thumbnails[5741007]=new thumbnail(5741007,"326086","Majesty of the Highlands","2010-02-04_006_thumb.jpg",130,195,32);thumbnails[5741008]=new thumbnail(5741008,"326086","Curves","2010-02-04_011_thumb.jpg",130,195,32);thumbnails[5741029]=new thumbnail(5741029,"326086","Fading Light","2010-02-04_016_thumb.jpg",130,195,32);thumbnails[3026065]=new thumbnail(3026065,"183783","Wave and Cloud","2008-09-17_126Wave and Cloud1_thumb.jpg",130,195,32);thumbnails[3014361]=new thumbnail(3014361,"183783","Swirling Sand","2008-09-17_089Swirling Sand_thumb.jpg",130,220,32);thumbnails[3014359]=new thumbnail(3014359,"183783","I Can See For Miles","2008-09-17_052I Can See For Miles_thumb.jpg",130,195,32);thumbnails[3014360]=new thumbnail(3014360,"183783","A Unique Landscape","2008-09-17_083A Unique Landscape_thumb.jpg",130,87,32);thumbnails[3014353]=new thumbnail(3014353,"183783","A Splash of Light","2008-09-17_004A Splash of Light_thumb.jpg",130,87,32);thumbnails[3014356]=new thumbnail(3014356,"183783","Worth Getting Out of Bed For","2008-09-17_012Worth Getting Out of Bed For_thumb.jpg",130,87,32);thumbnails[3014141]=new thumbnail(3014141,"183783","Layers of Light","2008-09-15_007Layers of Light_thumb.jpg",130,195,32);thumbnails[3014334]=new thumbnail(3014334,"183783","The Fairy Pools","2008-09-16_016Cuillin Flow_thumb.jpg",130,195,32);thumbnails[3014340]=new thumbnail(3014340,"183783","Looking Out to Sgurr na Stri","2008-09-16_024Looking Out to Sgurr na Stri_thumb.jpg",130,195,32);thumbnails[3014345]=new thumbnail(3014345,"183783","Breaking Wave Pt 1","2008-09-16_028Breaking Wave Pt 1_thumb.jpg",130,195,32);thumbnails[3014347]=new thumbnail(3014347,"183783","Breaking Wave Pt 2","2008-09-16_031Breaking Wave Pt 2_thumb.jpg",130,195,32);thumbnails[3014349]=new thumbnail(3014349,"183783","Breaking Wave Pt 3","2008-09-16_039Breaking Wave Pt 3_thumb.jpg",130,195,32);thumbnails[3014350]=new thumbnail(3014350,"183783","Splash!","2008-09-16_049Splash!_thumb.jpg",130,87,32);thumbnails[3014351]=new thumbnail(3014351,"183783","The Golden Hour","2008-09-16_058The Golden Hour_thumb.jpg",130,195,32);thumbnails[3014332]=new thumbnail(3014332,"183783","Reaching Out","2008-09-15_024Reaching Out_thumb.jpg",130,87,32);thumbnails[3014138]=new thumbnail(3014138,"183783","Sparkling Light","2007-11-11_078Sparkling Light_thumb.jpg",130,195,32);thumbnails[3014137]=new thumbnail(3014137,"183783","Light and Dark","2007-11-10_027Light and Dark_thumb.jpg",130,195,32);thumbnails[3014121]=new thumbnail(3014121,"183783","Strands of Light","2007-11-10_011Strands of Light_thumb.jpg",130,195,32);thumbnails[3622197]=new thumbnail(3622197,"183783","Tranquil Morning","IMG_2001Tranquil_Morning_thumb.jpg",130,195,32);thumbnails[3271813]=new thumbnail(3271813,"183783","The Three Graces at Night","2008-11-22_009The Three Graces at Night_thumb.jpg",130,87,32);thumbnails[3271816]=new thumbnail(3271816,"183783","The Liverpool Anglican Cathedral at Night","2008-11-22_013The Anglican Cathedral at Night_thumb.jpg",130,87,32);thumbnails[4053296]=new thumbnail(4053296,"183783","Endless Blue","2009-03-29_009_thumb.jpg",130,87,32);thumbnails[4053359]=new thumbnail(4053359,"183783","Arthur's View","2009-06-05_002_thumb.jpg",130,87,32);thumbnails[4053334]=new thumbnail(4053334,"183783","Delicate Beauty","2009-06-01_010_thumb.jpg",130,231,32);thumbnails[4053350]=new thumbnail(4053350,"183783","Summer's Day End","2009-06-02_001_thumb.jpg",130,190,32);thumbnails[4053320]=new thumbnail(4053320,"183783","Southern Seas","2009-05-31_001_thumb.jpg",130,195,32);thumbnails[4101975]=new thumbnail(4101975,"183783","Left by the Tide","2009-06-12_017_thumb.jpg",130,176,32);thumbnails[4101976]=new thumbnail(4101976,"183783","Pools of Light","2009-06-12_024_thumb.jpg",130,195,32);thumbnails[4101986]=new thumbnail(4101986,"183783","Lonely Trees","2009-06-13_030_thumb.jpg",130,195,32);thumbnails[4101988]=new thumbnail(4101988,"183783","Day Break","2009-06-13_037_thumb.jpg",130,195,32);thumbnails[4101999]=new thumbnail(4101999,"183783","Through the Keyhole","2009-06-13_048_thumb.jpg",130,195,32);thumbnails[4102004]=new thumbnail(4102004,"183783","The Path to...","2009-06-13_066_thumb.jpg",130,195,32);thumbnails[4102007]=new thumbnail(4102007,"183783","Reflection","2009-06-013_074_thumb.jpg",130,195,32);thumbnails[4102009]=new thumbnail(4102009,"183783","Rhododendrons in Bloom","2009-06-13_056_thumb.jpg",130,87,32);thumbnails[4102011]=new thumbnail(4102011,"183783","Red and Yellow","2009-06-15_002_thumb.jpg",130,195,32);thumbnails[4102015]=new thumbnail(4102015,"183783","Pink Sunset","2009-06-013_085_thumb.jpg",130,87,32);thumbnails[4861616]=new thumbnail(4861616,"183783","Morning Dew","2009-09-30_002_thumb.jpg",130,195,32);thumbnails[4861619]=new thumbnail(4861619,"183783","Fungi","2009-09-30_003_thumb.jpg",130,195,32);thumbnails[4861620]=new thumbnail(4861620,"183783","Autumn Berries","2009-09-30_007_thumb.jpg",130,195,32);thumbnails[4861621]=new thumbnail(4861621,"183783","Emerging Dawn","2009-10-01_005_thumb.jpg",130,87,32);thumbnails[4861627]=new thumbnail(4861627,"183783","Shapes in the Sand","2009-10-01_015_thumb.jpg",130,195,32);thumbnails[4861628]=new thumbnail(4861628,"183783","Fading","2009-10-01_040_thumb.jpg",130,195,32);thumbnails[4861629]=new thumbnail(4861629,"183783","A Murmuration at Sunset","2009-10-01_046_thumb.jpg",130,87,32);thumbnails[4861630]=new thumbnail(4861630,"183783","The Calm Before","2009-10-02_005_thumb.jpg",130,195,32);thumbnails[3014368]=new thumbnail(3014368,"185535","Red Sky at Night, Shepherd's Delight","2008-09-20_048Red Sky at Night, Shepherd's Delight_thumb.jpg",130,87,32);thumbnails[3014367]=new thumbnail(3014367,"185535","Watching the Sunset","2008-09-20_034Watching the Sunset_thumb.jpg",130,87,32);thumbnails[3014364]=new thumbnail(3014364,"185535","Windmills","2008-09-20_009Windmills_thumb.jpg",130,195,32);thumbnails[3014363]=new thumbnail(3014363,"185535","Another Place, Another Sunset","2008-09-20_003Another Place, Another Sunset_thumb.jpg",130,87,32);thumbnails[3014108]=new thumbnail(3014108,"185535","Simply Sunset","2007-06-08_042Simply Sunset_thumb.jpg",130,195,32);thumbnails[3014106]=new thumbnail(3014106,"185535","After the Tide","2007-06-08_025After the Tide_thumb.jpg",130,195,32);thumbnails[3014105]=new thumbnail(3014105,"185535","Looking Out to Sea","2007-06-08_021Looking Out To Sea_thumb.jpg",130,195,32);thumbnails[3014102]=new thumbnail(3014102,"185535","A Portrait of the Artist","2007-06-08_011A Portrait of the Artist_thumb.jpg",130,195,32);thumbnails[3014116]=new thumbnail(3014116,"183784","Red and Purple","2007-08-07_213Reds and Purples_thumb.jpg",130,195,32);thumbnails[3014112]=new thumbnail(3014112,"183784","Splendid Salvias","2007-08-07_170Splendid Salvias_thumb.jpg",130,195,32);thumbnails[3014109]=new thumbnail(3014109,"183784","Chillis and Lemons","2007-08-07_016Lemons and Chillis_thumb.jpg",130,195,32);thumbnails[3014084]=new thumbnail(3014084,"183784","Poppys","2004-07-26_001Poppys_thumb.jpg",130,87,32);thumbnails[3014045]=new thumbnail(3014045,"183784","Venetian Canals","2003-07-10_001Venetian Canals_thumb.jpg",130,194,32);var galleries=new Object();galleries[326086]=new gallery(326086,"5741007","*New*","gallery",[5735075,5740989,5740991,5740992,5740993,5740995,5740996,5740997,5740999,5741001,5741003,5741004,5741007,5741008,5741029]);galleries[183783]=new gallery(183783,"3014141","UK","gallery",[3026065,3014361,3014359,3014360,3014353,3014356,3014141,3014334,3014340,3014345,3014347,3014349,3014350,3014351,3014332,3014138,3014137,3014121,3622197,3271813,3271816,4053296,4053359,4053334,4053350,4053320,4101975,4101976,4101986,4101988,4101999,4102004,4102007,4102009,4102011,4102015,4861616,4861619,4861620,4861621,4861627,4861628,4861629,4861630]);galleries[185535]=new gallery(185535,"3014363,3014105,3014102","Burbo Bank","gallery",[3014368,3014367,3014364,3014363,3014108,3014106,3014105,3014102]);galleries[183784]=new gallery(183784,"3014116","Europe","gallery",[3014116,3014112,3014109,3014084,3014045]);var imageSets=new Object();imageSets[1]="5740997,4053359,3271813,3014367,3014356,3014353,3014351,3014349,3014105,3014102";imageSets[2]="5741007,3014363,3014141,3014116,3014105,3014102";imageSets[3]="5741029,5741008,5741007,5741004,5741003,5741001,5740999,5740997,5740996,5740995,5740993,5740992,5740991,5740989,5735075,4861630,4861629,4861628,4861627,4861621,4861620,4861619,4861616,4102015,4102011,4102009,4102007,4102004,4101999,4101988,4101986,4101976,4101975,4053359,4053350,4053334,4053320,4053296,3622197,3271816,3271813,3026065,3014368,3014367,3014364,3014363,3014361,3014360,3014359,3014356";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/rachellmccann/images";break}switch(a){case 1:b="http://www1.clikpic.com/rachellmccann/images";break}switch(a){case 2:b="http://admin.clikpic.com/rachellmccann/images";break}switch(a){case 24:b="http://tpc15/clikpic/rachellmccann/images";break}switch(a){case 4:b="http://www.clikchurch.com/rachellmccann/images";break}switch(a){case 5:b="http://www2.clikpic.com/rachellmccann/images";break}switch(a){case 22:b="http://tpc5/clikpic/rachellmccann/images";break}switch(a){case 23:b="http://tpc10/clikpic/rachellmccann/images";break}switch(a){case 25:b="http://tpc16/clikpic/rachellmccann/images";break}switch(a){case 15:b="http://www3.clikpic.com/rachellmccann/images";break}switch(a){case 18:b="http://www4.clikpic.com/rachellmccann/images";break}switch(a){case 19:b="http://www5.clikpic.com/rachellmccann/images";break}switch(a){case 31:b="http://www7.clikpic.com/rachellmccann/images";break}switch(a){case 32:b="http://admin2.clikpic.com/rachellmccann/images";break}switch(a){case 33:b="http://www8.clikpic.com/rachellmccann/images";break}switch(a){case 34:b="http://www9.clikpic.com/rachellmccann/images";break}switch(a){case 35:b="http://admin3.clikpic.com/rachellmccann/images";break}switch(a){case 37:b="http://admin4.clikpic.com/rachellmccann/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="Rachel McCann Landscape 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].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+'")'})}}};
