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[3101400]=new thumbnail(3101400,"109563","","Tiger9_thumb.jpg",130,194,18);thumbnails[1628348]=new thumbnail(1628348,"109563","","tiger1_thumb.jpg",130,195,18);thumbnails[1628349]=new thumbnail(1628349,"109563","","tiger-002_thumb.jpg",130,195,18);thumbnails[1628382]=new thumbnail(1628382,"109563","","tiger-013_thumb.jpg",130,195,18);thumbnails[3400249]=new thumbnail(3400249,"109563","","19_thumb.jpg",130,194,18);thumbnails[1628361]=new thumbnail(1628361,"109563","","tiger-006_thumb.jpg",130,195,18);thumbnails[1628367]=new thumbnail(1628367,"109563","","tiger-008_thumb.jpg",130,195,18);thumbnails[1628370]=new thumbnail(1628370,"109563","","tiger-009_thumb.jpg",130,195,18);thumbnails[3395338]=new thumbnail(3395338,"109563","","Tiger5_thumb.jpg",130,173,18);thumbnails[3395345]=new thumbnail(3395345,"109563","","Tiger6_thumb.jpg",130,173,18);thumbnails[3395351]=new thumbnail(3395351,"109563","","Tiger7_thumb.jpg",130,173,18);thumbnails[3395328]=new thumbnail(3395328,"109563","","tiger2_thumb.jpg",130,174,18);thumbnails[1628374]=new thumbnail(1628374,"109563","","Tiger8_thumb.jpg",130,98,18);thumbnails[1628353]=new thumbnail(1628353,"109563","","tiger3_thumb.jpg",130,87,18);thumbnails[1628363]=new thumbnail(1628363,"109563","","tiger-007_thumb.jpg",130,87,18);thumbnails[3395332]=new thumbnail(3395332,"109563","","Tiger4_thumb.jpg",130,98,18);thumbnails[1628293]=new thumbnail(1628293,"109565","","lion1_thumb.jpg",130,87,18);thumbnails[1628310]=new thumbnail(1628310,"109565","","lion2_thumb.jpg",130,87,18);thumbnails[1628321]=new thumbnail(1628321,"109565","","lion3_thumb.jpg",130,87,18);thumbnails[1628294]=new thumbnail(1628294,"109565","","lion-002_thumb.jpg",130,195,18);thumbnails[1628296]=new thumbnail(1628296,"109565","","lion-003_thumb.jpg",130,195,18);thumbnails[3395372]=new thumbnail(3395372,"109565","","lion7_thumb.jpg",130,225,18);thumbnails[3395380]=new thumbnail(3395380,"109565","","lion8_thumb.jpg",130,87,18);thumbnails[3395383]=new thumbnail(3395383,"109565","","lion9_thumb.jpg",130,99,18);thumbnails[3395367]=new thumbnail(3395367,"109565","","lion6_thumb.jpg",130,98,18);thumbnails[1628312]=new thumbnail(1628312,"109565","","lion-010_thumb.jpg",130,195,18);thumbnails[1628299]=new thumbnail(1628299,"109565","","lion005_thumb.jpg",130,195,18);thumbnails[1628320]=new thumbnail(1628320,"109565","","lion-012_thumb.jpg",130,195,18);thumbnails[3395386]=new thumbnail(3395386,"109565","","lion10_thumb.jpg",130,87,18);thumbnails[4381763]=new thumbnail(4381763,"109565","","lioness_thumb.jpg",130,195,18);thumbnails[4381764]=new thumbnail(4381764,"109565","","lioness2_thumb.jpg",130,87,18);thumbnails[1628437]=new thumbnail(1628437,"109566","","Othercat1_thumb.jpg",130,173,18);thumbnails[1628445]=new thumbnail(1628445,"109566","","Othercat4_thumb.jpg",130,194,18);thumbnails[3101162]=new thumbnail(3101162,"109566","","Othercat11_thumb.jpg",130,217,18);thumbnails[3100873]=new thumbnail(3100873,"109566","","Othercat9_thumb.jpg",130,194,18);thumbnails[1628443]=new thumbnail(1628443,"109566","","Othercat8_thumb.jpg",130,194,18);thumbnails[1628442]=new thumbnail(1628442,"109566","","Othercat6_thumb.jpg",130,219,18);thumbnails[1628444]=new thumbnail(1628444,"109566","","Othercat3_thumb.jpg",130,87,18);thumbnails[1628439]=new thumbnail(1628439,"109566","","Othercat5_thumb.jpg",130,87,18);thumbnails[3100877]=new thumbnail(3100877,"109566","","Othercat10_thumb.jpg",130,87,18);thumbnails[1628446]=new thumbnail(1628446,"109566","","Othercat7_thumb.jpg",130,87,18);thumbnails[1628438]=new thumbnail(1628438,"109566","","Othercat2_thumb..jpg",130,104,18);thumbnails[4381739]=new thumbnail(4381739,"109566","","jag_thumb.jpg",130,87,18);thumbnails[4381742]=new thumbnail(4381742,"109566","","jag2_thumb.jpg",130,87,18);thumbnails[4381759]=new thumbnail(4381759,"109566","","lepoard_thumb.jpg",130,87,18);thumbnails[4414474]=new thumbnail(4414474,"109566","","4E5S1774-Edit-Edit_thumb.jpg",130,87,18);thumbnails[4414485]=new thumbnail(4414485,"109566","","4E5S1820-Edit-2-Edit_thumb.jpg",130,87,18);thumbnails[4414522]=new thumbnail(4414522,"109566","","4E5S1829-Edit_thumb.jpg",130,87,18);thumbnails[1626771]=new thumbnail(1626771,"103409","","elephant-018_thumb.jpg",130,87,18);thumbnails[1626782]=new thumbnail(1626782,"103409","","elephant-020_thumb.jpg",130,87,18);thumbnails[1626783]=new thumbnail(1626783,"103409","","elephant-021_thumb.jpg",130,87,18);thumbnails[1611907]=new thumbnail(1611907,"103409","","elephant-001_thumb.jpg",130,87,18);thumbnails[1611923]=new thumbnail(1611923,"103409","","elephant-003_thumb.jpg",130,99,18);thumbnails[1611950]=new thumbnail(1611950,"103409","","elephant-010_thumb.jpg",130,103,18);thumbnails[1611958]=new thumbnail(1611958,"103409","","elephant-012_thumb.jpg",130,87,18);thumbnails[1612000]=new thumbnail(1612000,"103409","","elephant-017_thumb.jpg",130,87,18);thumbnails[1611968]=new thumbnail(1611968,"103409","","elephant-014_thumb.jpg",130,87,18);thumbnails[1611934]=new thumbnail(1611934,"103409","","elephant-006_thumb.jpg",130,114,18);thumbnails[1611928]=new thumbnail(1611928,"103409","","elephant-004_thumb.jpg",130,195,18);thumbnails[1611920]=new thumbnail(1611920,"103409","","elephant-002_thumb.jpg",130,195,18);thumbnails[1611938]=new thumbnail(1611938,"103409","","elephant-007_thumb.jpg",130,195,18);thumbnails[1611931]=new thumbnail(1611931,"103409","","elephant-005_thumb.jpg",130,195,18);thumbnails[1611946]=new thumbnail(1611946,"103409","","elephant-008_thumb.jpg",130,195,18);thumbnails[1611977]=new thumbnail(1611977,"103409","","elephant-015_thumb.jpg",130,195,18);thumbnails[1611990]=new thumbnail(1611990,"103409","","elephant-016_thumb.jpg",130,195,18);thumbnails[1611955]=new thumbnail(1611955,"103409","","elephant011_thumb.jpg",130,241,18);thumbnails[1626778]=new thumbnail(1626778,"103409","","elephant-019_thumb.jpg",130,195,18);var galleries=new Object();galleries[109563]=new gallery(109563,"3400249","Tigers","gallery",[3101400,1628348,1628349,1628382,3400249,1628361,1628367,1628370,3395338,3395345,3395351,3395328,1628374,1628353,1628363,3395332]);galleries[109565]=new gallery(109565,"3395372","Lions","gallery",[1628293,1628310,1628321,1628294,1628296,3395372,3395380,3395383,3395367,1628312,1628299,1628320,3395386,4381763,4381764]);galleries[109566]=new gallery(109566,"4414522,4381739,3101162","Other big cats","gallery",[1628437,1628445,3101162,3100873,1628443,1628442,1628444,1628439,3100877,1628446,1628438,4381739,4381742,4381759,4414474,4414485,4414522]);galleries[103409]=new gallery(103409,"1611946","Elephants","gallery",[1626771,1626782,1626783,1611907,1611923,1611950,1611958,1612000,1611968,1611934,1611928,1611920,1611938,1611931,1611946,1611977,1611990,1611955,1626778]);var imageSets=new Object();imageSets[1]="4414522,4414485,4381759,4381739,3400249,3101162,1628446,1628445,1628439,1628348,1628312,1628310";imageSets[2]="4414522,4381739,3400249,3395372,3101162,1611946";imageSets[3]="4414522,4414485,4414474,4381764,4381763,4381759,4381742,4381739,3400249,3395386,3395383,3395380,3395372,3395367,3395351,3395345,3395338,3395332,3395328,3101400,3101162,3100877,3100873,1628446,1628445,1628444,1628443,1628442,1628439,1628438,1628437,1628382,1628374,1628370,1628367,1628363,1628361,1628353,1628349,1628348,1628321,1628320,1628312,1628310,1628299,1628296,1628294,1628293,1626783,1626782";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/rayk57/images";break}switch(a){case 1:b="http://www1.clikpic.com/rayk57/images";break}switch(a){case 2:b="http://admin.clikpic.com/rayk57/images";break}switch(a){case 24:b="http://tpc15/clikpic/rayk57/images";break}switch(a){case 4:b="http://www.clikchurch.com/rayk57/images";break}switch(a){case 5:b="http://www2.clikpic.com/rayk57/images";break}switch(a){case 22:b="http://tpc5/clikpic/rayk57/images";break}switch(a){case 23:b="http://tpc10/clikpic/rayk57/images";break}switch(a){case 25:b="http://tpc16/clikpic/rayk57/images";break}switch(a){case 15:b="http://www3.clikpic.com/rayk57/images";break}switch(a){case 18:b="http://www4.clikpic.com/rayk57/images";break}switch(a){case 19:b="http://www5.clikpic.com/rayk57/images";break}switch(a){case 31:b="http://www7.clikpic.com/rayk57/images";break}switch(a){case 32:b="http://admin2.clikpic.com/rayk57/images";break}switch(a){case 33:b="http://www8.clikpic.com/rayk57/images";break}switch(a){case 34:b="http://www9.clikpic.com/rayk57/images";break}switch(a){case 35:b="http://admin3.clikpic.com/rayk57/images";break}switch(a){case 37:b="http://admin4.clikpic.com/rayk57/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="'+escape(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="RAKphotographic: "+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>"}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="rayk.666@btopenworld.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="rayk.666@btopenworld.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(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+'")'})}}};