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[1723263]=new thumbnail(1723263,"47197","Dead Leaves","leaves on stone_thumb.jpg",130,173,15);thumbnails[1723397]=new thumbnail(1723397,"47197","Glowing Grass","glowing grass_thumb.jpg",130,195,15);thumbnails[1723279]=new thumbnail(1723279,"47197","Dutch Lillies 2","dutch lillies 2_thumb.jpg",130,195,15);thumbnails[615280]=new thumbnail(615280,"47197","Yellow Green Leaves","yellowgreenleaves_thumb.jpg",130,191,15);thumbnails[615296]=new thumbnail(615296,"47197","In Memoriam","inmemoriam_thumb.jpg",130,195,15);thumbnails[615306]=new thumbnail(615306,"47197","A Bright Winter’s Day at Peterhead 1","seagulls_thumb.jpg",130,74,15);thumbnails[615299]=new thumbnail(615299,"47197","21 Crovie","crovie21_thumb.jpg",130,97,15);thumbnails[615266]=new thumbnail(615266,"47197","Dutch Lilies 1","dutchlillies1a_thumb.jpg",130,87,15);thumbnails[1723534]=new thumbnail(1723534,"47197","Pay Desk at MOMA","moma 2_thumb.jpg",130,104,15);thumbnails[615278]=new thumbnail(615278,"47197","Blue Silhouette","bluesilhouette1_thumb.jpg",130,98,15);thumbnails[615318]=new thumbnail(615318,"47205","Foggy River","foggyriver_thumb.jpg",130,86,15);thumbnails[615319]=new thumbnail(615319,"47205","Dune Fire","dunefire_thumb.jpg",130,87,15);thumbnails[615328]=new thumbnail(615328,"47205","New Forest Ponies","newforestponies1_thumb.jpg",130,75,15);thumbnails[629428]=new thumbnail(629428,"47205","Free as a Bird","soaringbird_thumb.jpg",130,102,15);thumbnails[629488]=new thumbnail(629488,"47205","Concrete Reality","concretereality_thumb.jpg",130,87,15);thumbnails[644102]=new thumbnail(644102,"47205","Strichen Park","striche bridge_thumb.jpg",130,190,15);thumbnails[1723441]=new thumbnail(1723441,"47205","Frozen Gate","frozen gate_thumb.jpg",130,83,15);thumbnails[1723541]=new thumbnail(1723541,"47205","Peterhead 2","peterhead2_thumb.jpg",130,97,15);thumbnails[629943]=new thumbnail(629943,"48140","Sunlight","treelight_thumb.jpg",130,87,15);thumbnails[644040]=new thumbnail(644040,"48140","Spring Trees","springtrees_thumb.jpg",130,87,15);thumbnails[644041]=new thumbnail(644041,"48140","Sinister","duthietrees1_thumb.jpg",130,87,15);thumbnails[644046]=new thumbnail(644046,"48140","Duthie Park","duthietrees2_thumb.jpg",130,195,15);thumbnails[644048]=new thumbnail(644048,"48140","Fallen Trees","fallentrees_thumb.jpg",130,195,15);thumbnails[644052]=new thumbnail(644052,"48140","Gorse","gorse_thumb.jpg",130,189,15);thumbnails[644058]=new thumbnail(644058,"48140","Winter in Central Park","mettrees_thumb.jpg",130,97,15);thumbnails[644193]=new thumbnail(644193,"48140","Spanish Tree","spanishtree_thumb.jpg",130,87,15);thumbnails[653032]=new thumbnail(653032,"48140","Snowy Trees","snowytrees_thumb.jpg",130,190,15);thumbnails[1723301]=new thumbnail(1723301,"48140","Sunlight 2","museummod art trees_thumb.jpg",130,195,15);thumbnails[5471619]=new thumbnail(5471619,"48140","Trees in Winter","Trees_in_Winter_thumb.jpg",130,195,15);thumbnails[629946]=new thumbnail(629946,"48139","Shetland Ponies","shetlandponies_thumb.jpg",130,130,15);thumbnails[630488]=new thumbnail(630488,"48139","New Forest Ponies 2","newforestponies2_thumb.jpg",130,97,15);thumbnails[630489]=new thumbnail(630489,"48139","Seagull","seagull_thumb.jpg",130,130,15);thumbnails[1723386]=new thumbnail(1723386,"48139","Paddy and Freddy","paddy and freddy_thumb.jpg",130,97,15);thumbnails[1723414]=new thumbnail(1723414,"48139","Nellie","nellie_thumb.jpg",130,196,15);thumbnails[1723432]=new thumbnail(1723432,"48139","Satie","satie_thumb.jpg",130,199,15);thumbnails[1724094]=new thumbnail(1724094,"48139","Mallard Duckling","edgars duck_thumb.jpg",130,119,15);thumbnails[1724096]=new thumbnail(1724096,"48139","Stabled Horse","white horse in stable_thumb.jpg",130,173,15);thumbnails[5471639]=new thumbnail(5471639,"48139","Bob Larkin","bob4_small_thumb.jpg",130,171,15);thumbnails[5473669]=new thumbnail(5473669,"48139","Rescued horses in mid winter","horse_group_in_snow11_thumb.jpg",130,87,15);thumbnails[5473849]=new thumbnail(5473849,"48139","Poppy and Merlin","poppy_and_merlin_2_thumb.jpg",130,169,15);thumbnails[5473930]=new thumbnail(5473930,"48139","Poppy in the snow","poppy_in_snow_1_thumb.jpg",130,195,15);thumbnails[653012]=new thumbnail(653012,"49793","On Duty","artguards1_thumb.jpg",130,173,15);thumbnails[653015]=new thumbnail(653015,"49793","The Bust","artguards2_thumb.jpg",130,168,15);thumbnails[653016]=new thumbnail(653016,"49793","Good Job!","artguards3_thumb.jpg",130,261,15);thumbnails[653018]=new thumbnail(653018,"49793","Closure","artguards4_thumb.jpg",130,173,15);thumbnails[615302]=new thumbnail(615302,"115747","Gaia","gaia_thumb.jpg",130,98,15);thumbnails[615323]=new thumbnail(615323,"115747","Deer Abbey","deerabbey_thumb.jpg",130,87,15);thumbnails[1723240]=new thumbnail(1723240,"115747","Choices","choices_1_thumb.jpg",130,107,15);thumbnails[1723611]=new thumbnail(1723611,"115747","Burning Fish","burning fish_thumb.jpg",130,195,15);thumbnails[5471569]=new thumbnail(5471569,"115747","Tempus Fugit","tempus_fugit_thumb.jpg",130,92,15);thumbnails[629495]=new thumbnail(629495,"115775","Secret Garden","secretgarden_thumb.jpg",130,191,15);thumbnails[630490]=new thumbnail(630490,"115775","In Dean Cemetary","deancemetary_thumb.jpg",130,164,15);thumbnails[1723327]=new thumbnail(1723327,"115775","Blue Bird Bath","blue bird bath 2_thumb.jpg",130,173,15);thumbnails[1723337]=new thumbnail(1723337,"115775","Stairs on Ellis Island","ellis stairs 2_thumb.jpg",130,173,15);thumbnails[1723360]=new thumbnail(1723360,"115775","Melbourne","melbourne_thumb.jpg",130,179,15);thumbnails[1723460]=new thumbnail(1723460,"115796","Land and Sky","coast 1_thumb.jpg",130,195,15);thumbnails[1723463]=new thumbnail(1723463,"115796","Rippled Water","coast 2_thumb.jpg",130,195,15);thumbnails[1723474]=new thumbnail(1723474,"115796","Sandscape","coast 3_thumb.jpg",130,98,15);thumbnails[1723494]=new thumbnail(1723494,"115796","Stone Steps","coast 4_thumb.jpg",130,195,15);thumbnails[1723506]=new thumbnail(1723506,"115796","Dunescape","coast 5_thumb.jpg",130,195,15);thumbnails[1723530]=new thumbnail(1723530,"115796","Dunescape 2","coast 6_thumb.jpg",130,174,15);thumbnails[5473769]=new thumbnail(5473769,"309777","Kate and Jenny 2","kate_and_little_jenny_thumb.jpg",130,162,15);thumbnails[5474022]=new thumbnail(5474022,"309777","Kate - Edinburgh 2008","kate_red_dress1_thumb.jpg",130,98,15);thumbnails[5474132]=new thumbnail(5474132,"309777","Kate and Jenny","kate_and_jenny_dark12_thumb.jpg",130,192,15);var galleries=new Object();galleries[47197]=new gallery(47197,"1723534,1723397,1723279,1723263,615306,615299,615296,615280,615278,615266","Light","gallery",[1723263,1723397,1723279,615280,615296,615306,615299,615266,1723534,615278]);galleries[47205]=new gallery(47205,"1723541,1723441,644102,629488,629428,615328,615319,615318","Landscapes","gallery",[615318,615319,615328,629428,629488,644102,1723441,1723541]);galleries[48140]=new gallery(48140,"5471619,1723301,653032,644193,644058,644052,644048,644046,644041,644040","Trees","gallery",[629943,644040,644041,644046,644048,644052,644058,644193,653032,1723301,5471619]);galleries[48139]=new gallery(48139,"5473930,5473849,5473669,5471639,1724096,1724094,1723432,1723414,1723386,630489","Animals","gallery",[629946,630488,630489,1723386,1723414,1723432,1724094,1724096,5471639,5473669,5473849,5473930]);galleries[49793]=new gallery(49793,"653018,653016,653015,653012","The Art Guards","gallery",[653012,653015,653016,653018]);galleries[115747]=new gallery(115747,"5471569,1723611,1723240,615323,615302","Unreal","gallery",[615302,615323,1723240,1723611,5471569]);galleries[115775]=new gallery(115775,"1723360,1723337,1723327,630490,629495","Portals","gallery",[629495,630490,1723327,1723337,1723360]);galleries[115796]=new gallery(115796,"1723530,1723506,1723494,1723474,1723463,1723460","Coast","gallery",[1723460,1723463,1723474,1723494,1723506,1723530]);galleries[309777]=new gallery(309777,"5474132,5474022,5473769","Family","gallery",[5473769,5474022,5474132]);var imageSets=new Object();imageSets[1]="5474132,5474022,5473930,5473849,5473769,5473669,5471639,5471619,5471569,1724096,1724094,1723611,1723541,1723534,1723530,1723506,1723494,1723474,1723463,1723460,1723441,1723432,1723414,1723397,1723386,1723360,1723337,1723327,1723301,1723279,1723263,1723240,653032,653018,653016,653015,653012,644193,644102,644058,644052,644048,644046,644041,644040,630490,630489,630488,629946,629943";imageSets[3]="5474132,5474022,5473930,5473849,5473769,5473669,5471639,5471619,5471569,1724096,1724094,1723611,1723541,1723534,1723530,1723506,1723494,1723474,1723463,1723460,1723441,1723432,1723414,1723397,1723386,1723360,1723337,1723327,1723301,1723279,1723263,1723240,653032,653018,653016,653015,653012,644193,644102,644058,644052,644048,644046,644041,644040,630490,630489,630488,629946,629943";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/nickjrobinson/images";break}switch(a){case 1:b="http://www1.clikpic.com/nickjrobinson/images";break}switch(a){case 2:b="http://admin.clikpic.com/nickjrobinson/images";break}switch(a){case 24:b="http://tpc15/clikpic/nickjrobinson/images";break}switch(a){case 4:b="http://www.clikchurch.com/nickjrobinson/images";break}switch(a){case 5:b="http://www2.clikpic.com/nickjrobinson/images";break}switch(a){case 22:b="http://tpc5/clikpic/nickjrobinson/images";break}switch(a){case 23:b="http://tpc10/clikpic/nickjrobinson/images";break}switch(a){case 25:b="http://tpc16/clikpic/nickjrobinson/images";break}switch(a){case 15:b="http://www3.clikpic.com/nickjrobinson/images";break}switch(a){case 18:b="http://www4.clikpic.com/nickjrobinson/images";break}switch(a){case 19:b="http://www5.clikpic.com/nickjrobinson/images";break}switch(a){case 31:b="http://www7.clikpic.com/nickjrobinson/images";break}switch(a){case 32:b="http://admin2.clikpic.com/nickjrobinson/images";break}switch(a){case 33:b="http://www8.clikpic.com/nickjrobinson/images";break}switch(a){case 34:b="http://www9.clikpic.com/nickjrobinson/images";break}switch(a){case 35:b="http://admin3.clikpic.com/nickjrobinson/images";break}switch(a){case 37:b="http://admin4.clikpic.com/nickjrobinson/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="Nick Robinson Images: "+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].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="nick@softoption.org.uk">';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="nick@softoption.org.uk">';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+'")'})}}};