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[4756416]=new thumbnail(4756416,"","My panel for the LRPS.  The Royal Photographic Society's Distinctions are recognised as a measure of achievement throughout the world.     The Licentiateship award requires 10 images which are assessed by a panel of 5 judges.   My panel was successful at Stirling, Scotland on 19 September 2009.","LRPS_Panel_small_thumb.jpg",130,71,1);thumbnails[5421290]=new thumbnail(5421290,"272709","","_RS_8275-Edit_thumb.jpg",92,130,1);thumbnails[5421294]=new thumbnail(5421294,"272709","","_RS_8258-Edit_thumb.jpg",89,130,1);thumbnails[5443849]=new thumbnail(5443849,"272709","","EARL-59-Edit_thumb.jpg",94,130,1);thumbnails[5603859]=new thumbnail(5603859,"272709","","EARL-83-Edit_thumb.jpg",130,91,1);thumbnails[5906760]=new thumbnail(5906760,"272709","","SAM-444-Edit_thumb.jpg",89,130,1);thumbnails[6058470]=new thumbnail(6058470,"272709","","Cage_1_b_thumb.jpg",130,87,1);thumbnails[6058473]=new thumbnail(6058473,"272709","","Chris_5_thumb.jpg",92,130,1);thumbnails[6058480]=new thumbnail(6058480,"272709","","4_w_cage_b_thumb.jpg",130,87,1);thumbnails[6058484]=new thumbnail(6058484,"272709","","2_w_Linx_thumb.jpg",130,87,1);thumbnails[6060876]=new thumbnail(6060876,"272709","","Neeson_1_thumb.jpg",130,87,1);thumbnails[5182166]=new thumbnail(5182166,"272709","","Rach_6_thumb.jpg",97,130,1);thumbnails[5266225]=new thumbnail(5266225,"272709","","LOU-624-Edit_thumb.jpg",90,130,1);thumbnails[5182175]=new thumbnail(5182175,"272709","","cagewar_5_thumb.jpg",88,130,1);thumbnails[4756710]=new thumbnail(4756710,"272709","","RMK_8785_8px_thumb.jpg",87,130,1);thumbnails[5182189]=new thumbnail(5182189,"272709","","cagewar_1_b_thumb.jpg",94,130,1);thumbnails[4756706]=new thumbnail(4756706,"272709","","Sarah_13in_thumb.jpg",83,130,1);thumbnails[4756901]=new thumbnail(4756901,"272709","","HOW-143-Edit_thumb.jpg",89,130,1);thumbnails[4756698]=new thumbnail(4756698,"272709","","IVE-1331_13in_thumb.jpg",87,130,1);thumbnails[4756919]=new thumbnail(4756919,"272709","","ROS-49_thumb.jpg",130,87,1);thumbnails[4756701]=new thumbnail(4756701,"272709","","HOW-57-Edit_thumb.jpg",130,93,1);thumbnails[4756922]=new thumbnail(4756922,"272709","","ROS-11_thumb.jpg",87,130,1);thumbnails[4757001]=new thumbnail(4757001,"272709","","NIC-82-Edit_thumb.jpg",85,130,1);thumbnails[5182192]=new thumbnail(5182192,"272709","","cagewar_7_web_thumb.jpg",91,130,1);thumbnails[4756704]=new thumbnail(4756704,"272709","","Carrie-87_13in_thumb.jpg",91,130,1);thumbnails[4757045]=new thumbnail(4757045,"272709","","QUB-46_8px_thumb.jpg",86,130,1);thumbnails[5405138]=new thumbnail(5405138,"272710","","Cushendall_A3_thumb.jpg",130,87,1);thumbnails[5906755]=new thumbnail(5906755,"272710","","cush_web_thumb.jpg",93,130,1);thumbnails[6147483]=new thumbnail(6147483,"272710","","New-192-Edit_thumb.jpg",130,80,1);thumbnails[6158600]=new thumbnail(6158600,"272710","","New-186-Edit_thumb.jpg",130,91,1);thumbnails[6158602]=new thumbnail(6158602,"272710","","New-191-Edit_thumb.jpg",130,69,1);thumbnails[4757170]=new thumbnail(4757170,"272710","","Belfast_HDR_13in_thumb.jpg",130,87,1);thumbnails[4757171]=new thumbnail(4757171,"272710","","HOL-20_3_in_thumb.jpg",130,86,1);thumbnails[4757154]=new thumbnail(4757154,"272710","","PUF-371-Edit_thumb.jpg",130,85,1);thumbnails[4757175]=new thumbnail(4757175,"272710","","IR-16-Edit_thumb.jpg",130,87,1);thumbnails[4757189]=new thumbnail(4757189,"272710","","Cushendun_Boat_web_thumb.jpg",87,130,1);thumbnails[4757298]=new thumbnail(4757298,"272710","","Trees_web_thumb.jpg",87,130,1);thumbnails[4757303]=new thumbnail(4757303,"272710","","8975_thumb.jpg",92,130,1);thumbnails[4757309]=new thumbnail(4757309,"272710","","Cushendun_web_thumb.jpg",130,87,1);thumbnails[4757319]=new thumbnail(4757319,"272710","","HOL-71-Edit_thumb.jpg",130,81,1);thumbnails[5603854]=new thumbnail(5603854,"272711","","_RS_4733_thumb.jpg",92,130,1);thumbnails[5722107]=new thumbnail(5722107,"272711","","UFM-121-Edit_thumb.jpg",89,130,1);thumbnails[5722113]=new thumbnail(5722113,"272711","","UFM-249_50_51_52_53_54_55_tonemapped_thumb.jpg",130,86,1);thumbnails[5722135]=new thumbnail(5722135,"272711","","_RS_5367_thumb.jpg",130,87,1);thumbnails[5906744]=new thumbnail(5906744,"272711","","_1010129-Edit_thumb.jpg",130,66,1);thumbnails[5906775]=new thumbnail(5906775,"272711","","Titanic_window_thumb.jpg",87,130,1);thumbnails[5929639]=new thumbnail(5929639,"272711","","XCMB-261-Edit_thumb.jpg",76,130,1);thumbnails[5954001]=new thumbnail(5954001,"272711","","BS-144-Edit_thumb.jpg",111,130,1);thumbnails[4757329]=new thumbnail(4757329,"272711","","UGP-188_thumb.jpg",130,95,1);thumbnails[5929638]=new thumbnail(5929638,"272711","","XCMB-309-Edit_thumb.jpg",91,130,1);thumbnails[4757333]=new thumbnail(4757333,"272711","","8848_8px_thumb.jpg",130,92,1);thumbnails[5931937]=new thumbnail(5931937,"272711","","XCMB-358-Edit_thumb.jpg",85,130,1);thumbnails[4757337]=new thumbnail(4757337,"272711","","On_the_nest_Ross_McKelvey_thumb.jpg",100,130,1);thumbnails[4757382]=new thumbnail(4757382,"272711","","Bass_Rock_web_thumb.jpg",87,130,1);thumbnails[4757585]=new thumbnail(4757585,"272711","","Gannet_web_thumb.jpg",130,87,1);thumbnails[4757945]=new thumbnail(4757945,"272711","","wat-92-Edit_thumb.jpg",130,89,1);thumbnails[4758029]=new thumbnail(4758029,"272711","","P1000110-Edit_thumb.jpg",130,81,1);thumbnails[4758031]=new thumbnail(4758031,"272711","","UGP-617_thumb.jpg",130,91,1);thumbnails[4759199]=new thumbnail(4759199,"272711","","_MG_8837_8px_thumb.jpg",98,130,1);thumbnails[4759707]=new thumbnail(4759707,"272711","","ZOO-87-Edit_thumb.jpg",130,90,1);thumbnails[5722080]=new thumbnail(5722080,"272711","","UFM-48-Edit_thumb.jpg",130,92,1);var galleries=new Object();galleries[272709]=new gallery(272709,"6060876,5603859,5421290,5266225,4756698","Portraits","section327758",[5421290,5421294,5443849,5603859,5906760,6058470,6058473,6058480,6058484,6060876,5182166,5266225,5182175,4756710,5182189,4756706,4756901,4756698,4756919,4756701,4756922,4757001,5182192,4756704,4757045]);galleries[272710]=new gallery(272710,"6158602,6158600,4757170","Landscapes","section327758",[5405138,5906755,6147483,6158600,6158602,4757170,4757171,4757154,4757175,4757189,4757298,4757303,4757309,4757319]);galleries[272711]=new gallery(272711,"5954001,5931937,5929638,5603854,4757329","Other","section327758",[5603854,5722107,5722113,5722135,5906744,5906775,5929639,5954001,4757329,5929638,4757333,5931937,4757337,4757382,4757585,4757945,4758029,4758031,4759199,4759707,5722080]);var imageSets=new Object();imageSets[1]="4756416";imageSets[2]="6158602,6158600,6060876,5954001,5931937,5929638,5603859,5603854,5421290,5266225,4757329,4757170,4756698";imageSets[3]="4756710,4756706,4756704,4756701,4756416";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/rossomck/images";break}switch(a){case 1:b="http://www1.clikpic.com/rossomck/images";break}switch(a){case 2:b="http://admin.clikpic.com/rossomck/images";break}switch(a){case 24:b="http://tpc15/clikpic/rossomck/images";break}switch(a){case 4:b="http://www.clikchurch.com/rossomck/images";break}switch(a){case 5:b="http://www2.clikpic.com/rossomck/images";break}switch(a){case 22:b="http://tpc5/clikpic/rossomck/images";break}switch(a){case 23:b="http://tpc10/clikpic/rossomck/images";break}switch(a){case 25:b="http://tpc16/clikpic/rossomck/images";break}switch(a){case 15:b="http://www3.clikpic.com/rossomck/images";break}switch(a){case 18:b="http://www4.clikpic.com/rossomck/images";break}switch(a){case 19:b="http://www5.clikpic.com/rossomck/images";break}switch(a){case 31:b="http://www7.clikpic.com/rossomck/images";break}switch(a){case 32:b="http://admin2.clikpic.com/rossomck/images";break}switch(a){case 33:b="http://www8.clikpic.com/rossomck/images";break}switch(a){case 34:b="http://www9.clikpic.com/rossomck/images";break}switch(a){case 35:b="http://admin3.clikpic.com/rossomck/images";break}switch(a){case 37:b="http://admin4.clikpic.com/rossomck/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("section327758"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section327758.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("section327758"!=""){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="Photography By Ross McKelvey LRPS: "+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>"}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>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+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="item_name" value="'+e+'">';ref="";if(c.photo_ref!=""){ref=c.photo_ref+" - "+c.caption}else{ref=c.id+" - "+c.caption}price=d;b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="ross.mckelvey@ntlworld.com">';b=b+'<input type="hidden" name="currency_code" value="GBP">';b=b+'<input type="hidden" name="add" value="1">';b=b+'<input type="hidden" name="amount" value="'+d+'">';b=b+'<input type="hidden" name="item_number" value="'+ref+'">';b=b+'<input type="Submit" value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";b=b+'<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="ross.mckelvey@ntlworld.com">';b=b+'<input type="hidden" name="display" value="1">';b=b+'<input type="Submit" value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";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+'")'})}}};