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[3021040]=new thumbnail(3021040,"185853","British Puma Helicopter","IMG_5200 copy_thumb.jpg",130,87,18);thumbnails[3021050]=new thumbnail(3021050,"185853","F3 Tornado","XE4E0283nn website copy_thumb.jpg",130,98,18);thumbnails[3021148]=new thumbnail(3021148,"185857","White Tailed Eagle","XE4E0109 copy copy_thumb.jpg",130,130,18);thumbnails[580258]=new thumbnail(580258,"185857","American Bald Eagle","sized__Baldeagle_thumb.JPG",98,130,18);thumbnails[580263]=new thumbnail(580263,"185857","European Eagle Owl","sized_EuropeanEagleOwl_thumb.JPG",98,130,18);thumbnails[3021139]=new thumbnail(3021139,"185857","Osprey","XE4E9606 copy copy_thumb.jpg",130,98,18);thumbnails[3021290]=new thumbnail(3021290,"185853","Tornado F3","XE4E0268nn copy copy_thumb.jpg",130,98,18);thumbnails[561789]=new thumbnail(561789,"41422","In Flight Puffin","sized_inflightpufin_thumb.JPG",130,98,18);thumbnails[762671]=new thumbnail(762671,"41422","Monarch Of The Glen","_MG_8678-copycs2resize_thumb.jpg",98,130,18);thumbnails[3021078]=new thumbnail(3021078,"41422","Bottlenose Dolphin","XE4E0155 copymkiii copy_thumb.jpg",130,98,18);thumbnails[533979]=new thumbnail(533979,"41422","May Island Puffin","sized_puffinflappingwings_thumb.JPG",130,130,18);thumbnails[3021056]=new thumbnail(3021056,"41422","Stonechat","sized_IMG_6129 copy_thumb.jpg",98,130,18);thumbnails[3021072]=new thumbnail(3021072,"41422","Bottlenose Dolphin","XE4E0267 copy copy_thumb.jpg",130,93,18);thumbnails[534056]=new thumbnail(534056,"41422","Puffin with fish","puffinwithfish_thumb.jpg",98,130,18);thumbnails[2875535]=new thumbnail(2875535,"41422","Kingfisher","sized__MG_0119-2_thumb.jpg",130,88,18);thumbnails[2875539]=new thumbnail(2875539,"41422","Grey Heron","sized__E4E0049_thumb.jpg",130,99,18);thumbnails[561778]=new thumbnail(561778,"41422","Scottish Wild Flower","sized_Fly on Flower_thumb.JPG",130,130,18);thumbnails[562398]=new thumbnail(562398,"41423","Alloa V Hearts","sized_AlloaHearts1_thumb.JPG",98,130,18);thumbnails[562402]=new thumbnail(562402,"41423","Seat Cupra Challange","sized_Seat going into tyre wall IMG_0293 copy_thumb.JPG",130,87,18);thumbnails[1385704]=new thumbnail(1385704,"41423","Mat Neal's Pit Girl","_MG_8130_thumb.jpg",98,130,18);thumbnails[1385710]=new thumbnail(1385710,"41423","Gordon Sheddons Civic on the Grid","_MG_8123_thumb.jpg",98,130,18);thumbnails[3021131]=new thumbnail(3021131,"41423","Thierry Henry","XE4E9000 copy copy_thumb.jpg",98,130,18);thumbnails[534011]=new thumbnail(534011,"41423","Blair Atholl Castle International Horse Trials 2006","sized_Horserider_thumb.JPG",98,130,18);thumbnails[1384809]=new thumbnail(1384809,"41423","Colin Montgomerie","_MG_3654 _thumb.jpg",98,130,18);thumbnails[1384932]=new thumbnail(1384932,"41423","Miguel Angel Jimenez","_MG_3737_thumb.jpg",98,130,18);thumbnails[1385141]=new thumbnail(1385141,"41423","Twice US Masters Champion, Phil Mickelson","_MG_3727_thumb.jpg",98,130,18);thumbnails[1385369]=new thumbnail(1385369,"41423","Colin McRae former World Rally Champion","IMG_0750 copy_thumb.jpg",98,130,18);thumbnails[3021090]=new thumbnail(3021090,"41423","Theirry Henry ","_MG_8591 copy copy_thumb.jpg",98,130,18);thumbnails[1385436]=new thumbnail(1385436,"41423","Colin McRae","Mcrae on track copy_thumb.jpg",130,98,18);thumbnails[1385536]=new thumbnail(1385536,"41423","Henry Arundel rolls his BMW single seater","_MG_7794_thumb.jpg",130,98,18);thumbnails[3021081]=new thumbnail(3021081,"41423","Fisher Spyder Special","XE4E0187 car 73copy copy_thumb.jpg",130,93,18);thumbnails[1385554]=new thumbnail(1385554,"41423","Colin Turkington during the British Touring Car Championship","_MG_7936_thumb.jpg",130,98,18);thumbnails[1385677]=new thumbnail(1385677,"41423","Nigel Rice driving in the Porsche Carrera Challenge","_MG_7999_thumb.jpg",130,98,18);thumbnails[1385692]=new thumbnail(1385692,"41423","Pete Osborne at The Seat Curves","_MG_7983_thumb.jpg",130,98,18);thumbnails[3021330]=new thumbnail(3021330,"41423","Blair Atholl International Horse Trials 2007","_MG_7443 copy_thumb.jpg",130,98,18);thumbnails[762694]=new thumbnail(762694,"59009","Autumn Sunset","sized_Edinburgh Sky LinePOTN_thumb.JPG",130,65,18);thumbnails[762696]=new thumbnail(762696,"59009","Arthurs Seat, Edinburgh","sized_IMG_3393 copy3_thumb.JPG",130,98,18);thumbnails[4431463]=new thumbnail(4431463,"59009","The Italian Chapel, Orkney","XE4E7667italianchapel_thumb.jpg",130,104,18);thumbnails[4004781]=new thumbnail(4004781,"59009","The Ring Of Brodgar","XE4E7759_thumb.jpg",130,87,18);thumbnails[3021278]=new thumbnail(3021278,"59009","Eilean Donan Castle","XE4E0168 copy copy1_thumb.jpg",130,98,18);thumbnails[618434]=new thumbnail(618434,"59009","Panorama of Edinburgh ","sized_IMG_3385 copy_thumb.JPG",130,43,18);thumbnails[762682]=new thumbnail(762682,"44660","Ineos Grangemouth","sized__MG_7888potn copy_thumb.JPG",130,98,18);thumbnails[1385722]=new thumbnail(1385722,"44660","Colin McRae former World Rally Champion Killed in Helicopter Accident","Mcrae-in-Pitlane-IMG_0759_thumb.jpg",98,130,18);thumbnails[1385869]=new thumbnail(1385869,"44660","Former World Rally Champion Killed in Helicopter Crash","Mcrae-at-Seat-Curves_thumb.jpg",130,98,18);thumbnails[1754636]=new thumbnail(1754636,"44660","Sea King Helicopter visits the QE2","_MG_8709 copy_thumb.jpg",130,98,18);thumbnails[2875563]=new thumbnail(2875563,"44660","Thierry Henry","_MG_8591 copy_thumb.jpg",97,130,18);thumbnails[580335]=new thumbnail(580335,"44660","Industrial Plant","sized__Industrial1_thumb.JPG",130,87,18);thumbnails[1385464]=new thumbnail(1385464,"44660","Serious Road Traffic Accident","_MG_3592_thumb.jpg",130,98,18);thumbnails[624245]=new thumbnail(624245,"44660","Robin and Cat","sized_Robin and Kat_thumb.JPG",98,130,18);thumbnails[580282]=new thumbnail(580282,"44660","New Coach for Hunters Of Alloa","sized__Huntersbus_thumb.JPG",130,87,18);thumbnails[949730]=new thumbnail(949730,"71860","Big Noise","Big-Noise_thumb.jpg",98,130,18);thumbnails[949733]=new thumbnail(949733,"71860","Bone Idol","Bone-Idol_thumb.jpg",98,130,18);thumbnails[1372573]=new thumbnail(1372573,"71860","Keren Woodward from Bananarama","_MG_7572_thumb.jpg",87,130,18);thumbnails[1385213]=new thumbnail(1385213,"71860","Sarah Dallin from Bananarama","_MG_7559 copy_thumb.jpg",98,130,18);thumbnails[1372579]=new thumbnail(1372579,"71860","Martin Fry lead singer ABC","_MG_7693_thumb.jpg",98,130,18);thumbnails[1385323]=new thumbnail(1385323,"71860","Phil Jupitus drools at Bananarama","CRW_6880 copy_thumb.jpg",98,130,18);thumbnails[561820]=new thumbnail(561820,"43348","The Courtyard Shot","sized_Jaccourtyard_thumb.JPG",130,130,18);thumbnails[562321]=new thumbnail(562321,"43348","Mons Meg Cannon","sized_canon_thumb.JPG",87,130,18);thumbnails[673940]=new thumbnail(673940,"43348","The Lovely Flower Girl","sized_wee bridesmaid_thumb.JPG",98,130,18);thumbnails[561855]=new thumbnail(561855,"43348","The Happy Couple","sized_jacandkennyatfireplace_thumb.JPG",130,130,18);thumbnails[705508]=new thumbnail(705508,"54213","Finlay","sized_Finlay1 copy_thumb.JPG",98,130,18);thumbnails[762835]=new thumbnail(762835,"54213","School Uniform!","_MG_7025sizedcamuniform_thumb.jpg",98,130,18);thumbnails[1414914]=new thumbnail(1414914,"54213","Ewan the Page Boy","_MG_3183_thumb.jpg",130,98,18);thumbnails[1754643]=new thumbnail(1754643,"54213","","_MG_9445_thumb.jpg",130,98,18);thumbnails[4431441]=new thumbnail(4431441,"54213","Finlay","XE4E8099BW_thumb.jpg",104,130,18);thumbnails[4431440]=new thumbnail(4431440,"54213","Eva","XE4E8076BW_thumb.jpg",104,130,18);thumbnails[3897568]=new thumbnail(3897568,"54213","Jamie","XE4E0683-finalcopyforwebsite_thumb.jpg",98,130,18);thumbnails[3897577]=new thumbnail(3897577,"54213","Callum","XE4E0728-finalcopyforwebsite_thumb.jpg",98,130,18);thumbnails[2765387]=new thumbnail(2765387,"54213","Rachel","XE4E9463 copyforwebsite_thumb.jpg",104,130,18);thumbnails[2765425]=new thumbnail(2765425,"54213","Sailor Girl","XE4E9384 forwebcopy_thumb.jpg",98,130,18);thumbnails[3021346]=new thumbnail(3021346,"54213","Montgomery Family Portrait","_MG_0429 copy_thumb.jpg",98,130,18);var galleries=new Object();galleries[185853]=new gallery(185853,"3021290,3021050,3021040","Aircraft","gallery",[3021040,3021050,3021290]);galleries[185857]=new gallery(185857,"3021148,3021139,580263,580258","Raptors","gallery",[3021148,580258,580263,3021139]);galleries[41422]=new gallery(41422,"3021078,3021072,3021056,2875539,2875535,762671,561789,561778,534056,533979","Nature","gallery",[561789,762671,3021078,533979,3021056,3021072,534056,2875535,2875539,561778]);galleries[41423]=new gallery(41423,"1385677,1385554,1384809","Sports","gallery",[562398,562402,1385704,1385710,3021131,534011,1384809,1384932,1385141,1385369,3021090,1385436,1385536,3021081,1385554,1385677,1385692,3021330]);galleries[59009]=new gallery(59009,"4004781","Landscapes","gallery",[762694,762696,4431463,4004781,3021278,618434]);galleries[44660]=new gallery(44660,"1385869,1385722,1385464","PR and Industrial Work","gallery",[762682,1385722,1385869,1754636,2875563,580335,1385464,624245,580282]);galleries[71860]=new gallery(71860,"949733","Performing Arts","gallery",[949730,949733,1372573,1385213,1372579,1385323]);galleries[43348]=new gallery(43348,"673940,562321,561855,561820","Wedding","gallery",[561820,562321,673940,561855]);galleries[54213]=new gallery(54213,"4431441,4431440,3897577,3897568,3021346,2765425,2765387,1754643,1414914,762835","Portrait","gallery",[705508,762835,1414914,1754643,4431441,4431440,3897568,3897577,2765387,2765425,3021346]);var imageSets=new Object();imageSets[1]="4004781,3897568,2875535,2765425,2765387,1385869,1385369,1384809,949733,762671,561820";imageSets[2]="4004781,1385869,1385722,1385677,1385554,1385464,1384809,949733";imageSets[3]="4431463,4431441,4431440,4004781,3897577,3897568,3021346,3021330,3021290,3021278,3021148,3021139,3021131,3021090,3021081,3021078,3021072,3021056,3021050,3021040,2875563,2875539,2875535,2765425,2765387,1754643,1754636,1414914,1385869,1385722,1385710,1385704,1385692,1385677,1385554,1385536,1385464,1385436,1385369,1385323,1385213,1385141,1384932,1384809,1372579,1372573,949733,949730,762835,762696";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 34:b="http://www9.clikpic.com/rickydiver/images";break}switch(a){case 1:b="http://www1.clikpic.com/rickydiver/images";break}switch(a){case 2:b="http://admin.clikpic.com/rickydiver/images";break}switch(a){case 4:b="http://www.clikchurch.com/rickydiver/images";break}switch(a){case 5:b="http://www2.clikpic.com/rickydiver/images";break}switch(a){case 15:b="http://www3.clikpic.com/rickydiver/images";break}switch(a){case 21:b="http://www6.clikpic.com/rickydiver/images";break}switch(a){case 18:b="http://www4.clikpic.com/rickydiver/images";break}switch(a){case 19:b="http://www5.clikpic.com/rickydiver/images";break}switch(a){case 22:b="http://tpc5/clikpic/rickydiver/images";break}switch(a){case 23:b="http://tpc10/clikpic/rickydiver/images";break}switch(a){case 24:b="http://tpc15/clikpic/rickydiver/images";break}switch(a){case 25:b="http://tpc16/clikpic/rickydiver/images";break}switch(a){case 31:b="http://www7.clikpic.com/rickydiver/images";break}switch(a){case 32:b="http://admin2.clikpic.com/rickydiver/images";break}switch(a){case 33:b="http://www8.clikpic.com/rickydiver/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="RICHARD HANNAH 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;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> 				&pound;"+c.item_price+"</p>";var e=c.purchase_instruction;var d=c.item_price;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="richardhannah@blueyonder.co.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="richardhannah@blueyonder.co.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+'")'})}}};
