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[2579222]=new thumbnail(2579222,"","","roger_thumb.slade.jpg",130,105,5);thumbnails[2580651]=new thumbnail(2580651,"","","1751_thumb.jpg",130,81,5);thumbnails[3106901]=new thumbnail(3106901,"","","insidescan0001f_thumb.jpg",130,109,5);thumbnails[3106902]=new thumbnail(3106902,"","","insidescan0002f_thumb.jpg",130,109,5);thumbnails[3543144]=new thumbnail(3543144,"","","web1_thumb.jpg",130,58,5);thumbnails[3543270]=new thumbnail(3543270,"","","web2_thumb.jpg",130,87,5);thumbnails[3543282]=new thumbnail(3543282,"","","web3_thumb.jpg",130,87,5);thumbnails[3543313]=new thumbnail(3543313,"","","web4_thumb.jpg",130,87,5);thumbnails[3543325]=new thumbnail(3543325,"","","web5_thumb.jpg",130,87,5);thumbnails[3543356]=new thumbnail(3543356,"","","web6_thumb.jpg",130,87,5);thumbnails[3543542]=new thumbnail(3543542,"","","web7_thumb.jpg",130,195,5);thumbnails[2520571]=new thumbnail(2520571,"161509","Iceberg arch and Zodiac","2037_thumb.jpg",130,87,5);thumbnails[2520634]=new thumbnail(2520634,"161509","Shag colony - I","013971_thumb.jpg",130,87,5);thumbnails[2522764]=new thumbnail(2522764,"161509","Penguins, Zodiac, ship","X7_thumb.jpg",130,87,5);thumbnails[2522811]=new thumbnail(2522811,"161509","Penguin chick in guano","016791_thumb.jpg",130,166,5);thumbnails[2522868]=new thumbnail(2522868,"161509","Penguins'reflection","0739_thumb.jpg",130,87,5);thumbnails[2522901]=new thumbnail(2522901,"161509","Penguins and rainbow","12971_thumb.jpg",130,195,5);thumbnails[2523346]=new thumbnail(2523346,"161509","Mountain light III","6103_thumb.jpg",130,87,5);thumbnails[2523347]=new thumbnail(2523347,"161509","Mountain light II","6081_thumb.jpg",130,87,5);thumbnails[2523358]=new thumbnail(2523358,"161509","Iceberg and dark sky","0445_thumb.jpg",130,87,5);thumbnails[2523374]=new thumbnail(2523374,"161509","Mushroom bergs","0946_thumb.jpg",130,90,5);thumbnails[2523381]=new thumbnail(2523381,"161509","Elephant seal II","0975_thumb.jpg",130,87,5);thumbnails[2527385]=new thumbnail(2527385,"161509","Bergs at sunset","2109_thumb.jpg",130,87,5);thumbnails[2527435]=new thumbnail(2527435,"161509","Mountain light I","2270_thumb.jpg",130,87,5);thumbnails[2527445]=new thumbnail(2527445,"161509","Mountain light IV","6163_thumb.jpg",130,87,5);thumbnails[2527462]=new thumbnail(2527462,"161509","Penguin colony","1312_thumb.jpg",130,87,5);thumbnails[2527813]=new thumbnail(2527813,"161509",'Snow - "Sarpik" deck',"1861_thumb.jpg",130,195,5);thumbnails[2527880]=new thumbnail(2527880,"161509","Young Fur Seal","1109_thumb.jpg",130,87,5);thumbnails[2527914]=new thumbnail(2527914,"161509","Sunset - Lemaire Channel","2138_thumb.jpg",130,85,5);thumbnails[2532552]=new thumbnail(2532552,"161509","Icebergs at sunset","1468_thumb.jpg",130,83,5);thumbnails[2532563]=new thumbnail(2532563,"161509","Mountain light V","6190_thumb.jpg",130,87,5);thumbnails[2533038]=new thumbnail(2533038,"161509","Lemaire Channel","6667_thumb.jpg",130,87,5);thumbnails[2533046]=new thumbnail(2533046,"161509","Shag colony II","01438_thumb.jpg",130,87,5);thumbnails[2533054]=new thumbnail(2533054,"161509","Penguin chick and snow","01691_thumb.jpg",130,87,5);thumbnails[2533061]=new thumbnail(2533061,"161509",'Fur Seal and "Orlova"',"01535_thumb.jpg",130,195,5);thumbnails[2533071]=new thumbnail(2533071,"161509","Tilted iceberg","8989_thumb.jpg",130,195,5);thumbnails[2533111]=new thumbnail(2533111,"161509","Large iceberg","2024_thumb.jpg",130,195,5);thumbnails[2533366]=new thumbnail(2533366,"161509","King Penguin chick","5514_thumb.jpg",130,88,5);thumbnails[2533431]=new thumbnail(2533431,"161509",'Iceberg and "Sarpik"',"1993_thumb.jpg",130,87,5);thumbnails[2533600]=new thumbnail(2533600,"161509","Chick on Port Lockroy boot scraper","9276_thumb.jpg",130,182,5);thumbnails[2533615]=new thumbnail(2533615,"161509","Elephant Seal I","56701_thumb.jpg",130,190,5);thumbnails[2579747]=new thumbnail(2579747,"161509","Gentoo and two chicks","1230_thumb.jpg",130,103,5);thumbnails[2579755]=new thumbnail(2579755,"161509","Backlit iceberg","2107_thumb.jpg",130,87,5);thumbnails[2523650]=new thumbnail(2523650,"161510","Turret iceberg and Zodiac","2026_thumb.jpg",130,195,5);thumbnails[2523921]=new thumbnail(2523921,"161510","Gentoo and chick on nest","1219_thumb.jpg",130,87,5);thumbnails[2527381]=new thumbnail(2527381,"161510","Penguins and blue icebergs","01696_thumb.jpg",130,87,5);thumbnails[2527391]=new thumbnail(2527391,"161510","Flying Black Browed Albatross II","5424_thumb.jpg",130,85,5);thumbnails[2527798]=new thumbnail(2527798,"161510","Ice landscape","2378_thumb.jpg",130,87,5);thumbnails[2527983]=new thumbnail(2527983,"161510","Flying Black Browed Albatross I","5421_thumb.jpg",130,84,5);thumbnails[2532588]=new thumbnail(2532588,"161510","Chin Strap Penguin","5975_thumb.jpg",130,195,5);thumbnails[2533026]=new thumbnail(2533026,"161510","Abandoned huts","2126_thumb.jpg",130,87,5);thumbnails[2533379]=new thumbnail(2533379,"161510","Icebergs","8234_thumb.jpg",130,195,5);thumbnails[2533606]=new thumbnail(2533606,"161510","Mushroom ice","0940_thumb.jpg",130,87,5);thumbnails[2542794]=new thumbnail(2542794,"161510","Rock Hopper","0775_thumb.jpg",130,97,5);thumbnails[2542894]=new thumbnail(2542894,"161510","Penguin and chicks","0991_thumb.jpg",130,195,5);thumbnails[2542954]=new thumbnail(2542954,"161510","Penguins going into sea","1761_thumb.jpg",130,87,5);thumbnails[2542975]=new thumbnail(2542975,"161510","Zodiac","2430_thumb.jpg",130,64,5);thumbnails[2542984]=new thumbnail(2542984,"161510","Crevasses","2441_thumb.jpg",130,87,5);thumbnails[2543793]=new thumbnail(2543793,"161510","Black Browed Albatross and nest","5385_thumb.jpg",130,195,5);thumbnails[2543851]=new thumbnail(2543851,"161510",'"Orlova", Neko Harbour',"0715_thumb.jpg",130,86,5);thumbnails[2543938]=new thumbnail(2543938,"161510","Penguin and camera","4644_thumb.jpg",130,95,5);thumbnails[2544751]=new thumbnail(2544751,"161510",'"Sarpik"',"08491_thumb.jpg",130,90,5);thumbnails[2545105]=new thumbnail(2545105,"161510","Deception steam","0757_thumb.jpg",130,73,5);thumbnails[2545168]=new thumbnail(2545168,"161510","Ice","0914_thumb.jpg",130,173,5);thumbnails[2553922]=new thumbnail(2553922,"161510","Penguin and chicks on nest","1932_thumb.jpg",130,171,5);thumbnails[2553980]=new thumbnail(2553980,"161510","Penguin coming ashore","2094_thumb.jpg",130,180,5);thumbnails[2556011]=new thumbnail(2556011,"161510","Seal pup","1253_thumb.jpg",130,88,5);thumbnails[2556042]=new thumbnail(2556042,"161510","Adelies at sunset","1463_thumb.jpg",130,87,5);thumbnails[2556079]=new thumbnail(2556079,"161510","Zodiac iceberg cruise","2172_thumb.jpg",130,87,5);thumbnails[2556139]=new thumbnail(2556139,"161510",'"Orlova" and bergy bits',"2410_thumb.jpg",130,198,5);thumbnails[2556278]=new thumbnail(2556278,"161510","Sunset","1470_thumb.jpg",130,74,5);thumbnails[2556302]=new thumbnail(2556302,"161510","Chin Strap head","2037a_thumb.jpg",130,101,5);thumbnails[2556349]=new thumbnail(2556349,"161510","Glacier pattern","2284_thumb.jpg",130,87,5);thumbnails[2579749]=new thumbnail(2579749,"161510",'"Orlova" at sunrise',"2225_thumb.jpg",130,87,5);thumbnails[3103430]=new thumbnail(3103430,"191051","","coverscan0001f_thumb.jpg",130,110,5);var galleries=new Object();galleries[161509]=new gallery(161509,"2520571","Antarctica Miscellany - Gallery 1","gallery",[2520571,2520634,2522764,2522811,2522868,2522901,2523346,2523347,2523358,2523374,2523381,2527385,2527435,2527445,2527462,2527813,2527880,2527914,2532552,2532563,2533038,2533046,2533054,2533061,2533071,2533111,2533366,2533431,2533600,2533615,2579747,2579755]);galleries[161510]=new gallery(161510,"2523921","Antarctica Miscellany - Gallery 2","gallery",[2523650,2523921,2527381,2527391,2527798,2527983,2532588,2533026,2533379,2533606,2542794,2542894,2542954,2542975,2542984,2543793,2543851,2543938,2544751,2545105,2545168,2553922,2553980,2556011,2556042,2556079,2556139,2556278,2556302,2556349,2579749]);galleries[191051]=new gallery(191051,"3103430",'My book "Antarctica"',"gallery",[3103430]);var imageSets=new Object();imageSets[1]="2520571";imageSets[2]="3103430,2523921,2520571";imageSets[3]="3543542,3543356,3543325,3543313,3543282,3543270,3543144,3106902,3106901,3103430,2580651,2579755,2579749,2579747,2579222,2556349,2556302,2556278,2556139,2556079,2556042,2556011,2553980,2553922,2545168,2545105,2544751,2543938,2543851,2543793,2542984,2542975,2542954,2542894,2542794,2533615,2533606,2533600,2533431,2533379,2533366,2533111,2533071,2533061,2533054,2533046,2533038,2533026,2532588,2532563";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/rogslade/images";break}switch(a){case 1:b="http://www1.clikpic.com/rogslade/images";break}switch(a){case 2:b="http://admin.clikpic.com/rogslade/images";break}switch(a){case 24:b="http://tpc15/clikpic/rogslade/images";break}switch(a){case 4:b="http://www.clikchurch.com/rogslade/images";break}switch(a){case 5:b="http://www2.clikpic.com/rogslade/images";break}switch(a){case 22:b="http://tpc5/clikpic/rogslade/images";break}switch(a){case 23:b="http://tpc10/clikpic/rogslade/images";break}switch(a){case 25:b="http://tpc16/clikpic/rogslade/images";break}switch(a){case 15:b="http://www3.clikpic.com/rogslade/images";break}switch(a){case 18:b="http://www4.clikpic.com/rogslade/images";break}switch(a){case 19:b="http://www5.clikpic.com/rogslade/images";break}switch(a){case 31:b="http://www7.clikpic.com/rogslade/images";break}switch(a){case 32:b="http://admin2.clikpic.com/rogslade/images";break}switch(a){case 33:b="http://www8.clikpic.com/rogslade/images";break}switch(a){case 34:b="http://www9.clikpic.com/rogslade/images";break}switch(a){case 35:b="http://admin3.clikpic.com/rogslade/images";break}switch(a){case 37:b="http://admin4.clikpic.com/rogslade/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="Roger Slade Photo: "+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="rogslade@hotmail.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="rogslade@hotmail.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+'")'})}}};