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[1784888]=new thumbnail(1784888,"","Heidkampf","DSC_3086web_thumb.jpg",130,86,1);thumbnails[3192913]=new thumbnail(3192913,"","","COOLTE~2_thumb.GIF",130,18,1);thumbnails[3241935]=new thumbnail(3241935,"","LensesLatest","LensesLatestweb_thumb.jpg",130,52,1);thumbnails[3243206]=new thumbnail(3243206,"","Canon Compacts","CanonCompacts_web_thumb.jpg",130,49,1);thumbnails[3359722]=new thumbnail(3359722,"","About Me_7","AboutMe_7web_thumb.jpg",130,65,1);thumbnails[3413746]=new thumbnail(3413746,"","DX-D80_90web","DX-D80_90web_thumb.jpg",130,65,1);thumbnails[3581088]=new thumbnail(3581088,"","Ultimate Reading","DSC_0285cWeb_thumb.jpg",130,107,1);thumbnails[3597945]=new thumbnail(3597945,"","About Me","DSC_0773m2Web_thumb.jpg",130,65,1);thumbnails[3598100]=new thumbnail(3598100,"","About Me 9","AboutMe_9_thumb.jpg",130,65,1);thumbnails[3622307]=new thumbnail(3622307,"","Cuckoo","DSC_2965cWeb_thumb.jpg",130,97,1);thumbnails[3765228]=new thumbnail(3765228,"","Freediver","DSC_1206xmweb21_thumb.jpg",130,92,1);thumbnails[5280648]=new thumbnail(5280648,"","Links page photo","DSC_6866weblinks_thumb.jpg",130,158,1);thumbnails[5491914]=new thumbnail(5491914,"","","AboutMe_6web_thumb.jpg",130,65,1);thumbnails[5681244]=new thumbnail(5681244,"","","DSC_2352web_thumb.jpg",130,181,1);thumbnails[6180965]=new thumbnail(6180965,"","DX-D80 photos","DX-D80_web_thumb.jpg",130,35,1);thumbnails[5095666]=new thumbnail(5095666,"","Anglerfish","DSC_3339zb2web_thumb.jpg",130,92,1);thumbnails[3641548]=new thumbnail(3641548,"","Blennies","tompotsX3web_thumb.jpg",130,85,1);thumbnails[1779026]=new thumbnail(1779026,"","Diver & Carp","DSC_5501mweb_thumb.jpg",130,92,1);thumbnails[1788081]=new thumbnail(1788081,"","Soup Tin","IMG_5121cweb_thumb.jpg",130,95,1);thumbnails[3220899]=new thumbnail(3220899,"","Hermits","DSC_6364mweb_thumb.jpg",130,92,1);thumbnails[3244465]=new thumbnail(3244465,"","Cool Urchin","DSC_2845web2_thumb.jpg",130,100,1);thumbnails[4937710]=new thumbnail(4937710,"","China Rockfish","DSC_4449web_thumb.jpg",130,99,1);thumbnails[4937693]=new thumbnail(4937693,"","Metridium","DSC_4590web_thumb.jpg",130,182,1);thumbnails[4066377]=new thumbnail(4066377,"119300","Nudibranch","DSC_2237cweb_thumb.jpg",130,92,1);thumbnails[3373788]=new thumbnail(3373788,"119300","Mussels","DSC_0568web_thumb.jpg",130,86,1);thumbnails[4085940]=new thumbnail(4085940,"119300","Sea-gooseberry","DSC_2920web2_thumb.jpg",130,88,1);thumbnails[3373827]=new thumbnail(3373827,"119300","File shell","DSC_0596cweb_thumb.jpg",130,92,1);thumbnails[1783143]=new thumbnail(1783143,"119300","Hermit crab","IMG_2502web_thumb.jpg",130,92,1);thumbnails[2211283]=new thumbnail(2211283,"119300","Jewels","T_Rees_thumb.MacroWeb.jpg",130,97,1);thumbnails[3914056]=new thumbnail(3914056,"119300","Barnacles","DSC_2263web_thumb.jpg",130,97,1);thumbnails[1788781]=new thumbnail(1788781,"119300","Pipefish","DSC_2208web_thumb.jpg",130,92,1);thumbnails[3220901]=new thumbnail(3220901,"119321","Edibles","DSC_5998cweb_thumb.jpg",130,92,1);thumbnails[3219567]=new thumbnail(3219567,"119321","Ballan","DSC_7070cmweb_thumb.jpg",130,98,1);thumbnails[1787891]=new thumbnail(1787891,"119321","Wolf fish","DSC_1641web_thumb.jpg",130,93,1);thumbnails[2468776]=new thumbnail(2468776,"119321","Conger Eel","DSC_9232cweb_thumb.jpg",130,87,1);thumbnails[1784882]=new thumbnail(1784882,"119321","Scampi","DSC_7175web_thumb.jpg",130,92,1);thumbnails[2257861]=new thumbnail(2257861,"119321","Lobster","DSC_8208web_thumb.jpg",130,92,1);thumbnails[2272282]=new thumbnail(2272282,"119321","Crawfish","DSC_4612web_thumb.jpg",130,95,1);thumbnails[5934449]=new thumbnail(5934449,"119321","Rockling","DSC_0708cwebart_thumb.jpg",130,83,1);thumbnails[3612167]=new thumbnail(3612167,"119322","Sunstar","DSC_6038c2web_thumb.jpg",130,184,1);thumbnails[1783216]=new thumbnail(1783216,"119322","Hand/shotline","DSC_2812web_thumb.jpg",130,196,1);thumbnails[3244499]=new thumbnail(3244499,"119322","Umbrella","DSC_2805cweb_thumb.jpg",130,184,1);thumbnails[3216575]=new thumbnail(3216575,"119322","Light rays","IMG_7468web_thumb.jpg",130,184,1);thumbnails[1779594]=new thumbnail(1779594,"119322","4 Cuttlefish","IMG_1655web_thumb.jpg",130,92,1);thumbnails[5299216]=new thumbnail(5299216,"119322","Sunken boat","DSC_6283web_DB4F204F-1D09-001F-9947115E7D23DD32_thumb.jpg",130,92,1);thumbnails[5956551]=new thumbnail(5956551,"119322","Grey Seal","DSC_3532web_thumb.jpg",130,89,1);thumbnails[1827284]=new thumbnail(1827284,"119322","Wreck hull","DSC_5812web_thumb.jpg",130,93,1);thumbnails[3568365]=new thumbnail(3568365,"218175","Perch ","DSC_1622m2web_thumb.jpg",130,184,1);thumbnails[3568677]=new thumbnail(3568677,"218175","Trout","DSC_0555cWeb_thumb.jpg",130,90,1);thumbnails[3568805]=new thumbnail(3568805,"218175","Carp","DSC_5226mWeb_thumb.jpg",130,95,1);thumbnails[3837147]=new thumbnail(3837147,"218175","Frog","DSC_2384webart_thumb.jpg",130,157,1);thumbnails[3122219]=new thumbnail(3122219,"218175","Pike","DSC_1490web_thumb.jpg",130,82,1);thumbnails[3836350]=new thumbnail(3836350,"218175","Newt","DSC_2102web_thumb.jpg",130,184,1);thumbnails[3123281]=new thumbnail(3123281,"218175","Crayfish","DSC_1421cweb_thumb.jpg",130,173,1);thumbnails[3568544]=new thumbnail(3568544,"218175","Roach","DSC_4168zbWeb_thumb.jpg",130,83,1);thumbnails[3446207]=new thumbnail(3446207,"206104","Cross jelly","DSC_3566web_thumb.jpg",130,108,1);thumbnails[2468908]=new thumbnail(2468908,"206104","Flatworm","DSC_9183cweb_thumb.jpg",130,90,1);thumbnails[3375072]=new thumbnail(3375072,"206104","Dahlia ","IMG_3711cB&Wweb_thumb.jpg",130,92,1);thumbnails[3374423]=new thumbnail(3374423,"206104","Nudibranch","MartHavNudi_web_thumb.jpg",130,97,1);thumbnails[1827306]=new thumbnail(1827306,"206104","Mini","DSC_5727b&wWeb_thumb.jpg",130,87,1);thumbnails[3375054]=new thumbnail(3375054,"206104","Tunicates","DSC_8553bwglowedgeweb_thumb.jpg",130,92,1);thumbnails[3375121]=new thumbnail(3375121,"206104","Wrasse","DSC_7086bwWeb_thumb.jpg",130,99,1);thumbnails[1827267]=new thumbnail(1827267,"206104","Teckie","DSC_5804bwWeb_thumb.jpg",130,91,1);thumbnails[5093370]=new thumbnail(5093370,"280963","Goldsinny","DSC_3356web_thumb.jpg",130,100,1);thumbnails[4937716]=new thumbnail(4937716,"280963","Nudibranch","DSC_4962web_thumb.jpg",130,99,1);thumbnails[4937699]=new thumbnail(4937699,"280963","Medusa","DSC_4168web_thumb.jpg",130,104,1);thumbnails[5093266]=new thumbnail(5093266,"280963","Plaice","DSC_3096web_thumb.jpg",130,89,1);thumbnails[1791119]=new thumbnail(1791119,"280963","Hamburg wreck","DSC_3380web_thumb.jpg",130,89,1);thumbnails[5095674]=new thumbnail(5095674,"280963","Lumpsucker","DSC_3487web_thumb.jpg",130,92,1);thumbnails[4937705]=new thumbnail(4937705,"280963","Kelp Greenling","DSC_5489web_thumb.jpg",130,94,1);thumbnails[5093374]=new thumbnail(5093374,"280963","Fish shoal","DSC_0527cweb_thumb.jpg",130,87,1);thumbnails[4937694]=new thumbnail(4937694,"280963","Wall & Diver","DSC_4658web_thumb.jpg",130,187,1);thumbnails[5094564]=new thumbnail(5094564,"280963","Hydroid","DSC_3213web_thumb.jpg",130,190,1);thumbnails[4937692]=new thumbnail(4937692,"280963","Telia & Kelp","DSC_4784web_thumb.jpg",130,189,1);thumbnails[4937531]=new thumbnail(4937531,"280963","Diver/Kelp","DSC_5157web_thumb.jpg",130,190,1);thumbnails[2957672]=new thumbnail(2957672,"119325","Clown fish","DSC_1991m2web_thumb.jpg",130,102,1);thumbnails[1784891]=new thumbnail(1784891,"119325","Tubeworm","IMG_0023web_thumb.jpg",130,92,1);thumbnails[2957601]=new thumbnail(2957601,"119325","Boxfish","DSC_1059web_thumb.jpg",130,92,1);thumbnails[1780121]=new thumbnail(1780121,"119325","Cave Divers","IMG_2289web_thumb.jpg",130,97,1);thumbnails[3097925]=new thumbnail(3097925,"119325","Puffer eye","DSC_1510web_thumb.jpg",130,108,1);thumbnails[5552443]=new thumbnail(5552443,"119325","Glass fish","DSC_0946cweb_thumb.jpg",130,90,1);thumbnails[1788168]=new thumbnail(1788168,"119325","Burrfish","DSC_1848m2web_thumb.jpg",130,92,1);thumbnails[5552439]=new thumbnail(5552439,"119325","Shrimp","DSC_2072cweb_thumb.jpg",130,100,1);thumbnails[3218985]=new thumbnail(3218985,"119325","Canyon","IMG_2302cweb_thumb.jpg",130,184,1);thumbnails[1798100]=new thumbnail(1798100,"119325","Frogfish","DSC_0897web_thumb.jpg",130,184,1);thumbnails[1780123]=new thumbnail(1780123,"119325","Jellyfish/Diver","IMG_2331web1_thumb.jpg",130,184,1);thumbnails[1785273]=new thumbnail(1785273,"119325","Diver/Fish","DSC_1156web_thumb.jpg",130,184,1);thumbnails[5816967]=new thumbnail(5816967,"119324","Spider crab","DSC_2878webart_12EF0108-24E8-5EC4-4F67DB1FD383B427_thumb.jpg",130,92,1);thumbnails[5263406]=new thumbnail(5263406,"119324","Open portfolio 2009","T_Rees_Op09web_thumb.jpg",130,98,1);thumbnails[4954237]=new thumbnail(4954237,"119324","UK Portfolio 2009","T_Rees_Brit09web_thumb.jpg",130,97,1);thumbnails[3602601]=new thumbnail(3602601,"119324","Theme Portfolio 2009","BSoUP_theme09web_thumb.jpg",130,97,1);thumbnails[2945387]=new thumbnail(2945387,"119324","UK portfolio 2008","UK portfolio_08web_thumb.jpg",130,97,1);thumbnails[2468553]=new thumbnail(2468553,"119324","Diver & Dome","DSC_4040web_thumb.jpg",130,92,1);thumbnails[1783029]=new thumbnail(1783029,"119324","Rockpool","DSC_0875web_thumb.jpg",130,92,1);thumbnails[1783078]=new thumbnail(1783078,"119324","Big Eye","DSC_1758mweb_thumb.jpg",130,92,1);thumbnails[1783010]=new thumbnail(1783010,"119324","UK portfolio 2007","T_Rees_Brit07web_thumb.jpg",130,97,1);thumbnails[3216650]=new thumbnail(3216650,"119324","Two Pike","DSC_1496mweb_thumb.jpg",130,91,1);thumbnails[1784917]=new thumbnail(1784917,"119324","Cuttlefish","IMG_1648web_thumb.jpg",130,92,1);thumbnails[5816931]=new thumbnail(5816931,"119324","Box fish","puffersx2webart_12E46A1A-24E8-5EC4-4F10C6DFD63AF957_thumb.jpg",130,92,1);var galleries=new Object();galleries[119300]=new gallery(119300,"4085940,4066377,3914056,3373827,3373788,2211283,1788781,1783143","Macro ","gallery",[4066377,3373788,4085940,3373827,1783143,2211283,3914056,1788781]);galleries[119321]=new gallery(119321,"5934449,3220901,3219567,2468776,2272282,2257861,1787891,1784882","Medium size","gallery",[3220901,3219567,1787891,2468776,1784882,2257861,2272282,5934449]);galleries[119322]=new gallery(119322,"5956551,5299216,3612167,3244499,3216575,1827284,1783216,1779594","Wide angle","gallery",[3612167,1783216,3244499,3216575,1779594,5299216,5956551,1827284]);galleries[218175]=new gallery(218175,"3837147,3836350,3568805,3568677,3568544,3568365,3123281,3122219","Freshwater","gallery",[3568365,3568677,3568805,3837147,3122219,3836350,3123281,3568544]);galleries[206104]=new gallery(206104,"3446207,3375121,3375072,3375054,3374423,2468908,1827306,1827267","Monochrome","gallery",[3446207,2468908,3375072,3374423,1827306,3375054,3375121,1827267]);galleries[280963]=new gallery(280963,"5095674,5094564,5093374,5093370,5093266,4937716,4937705,4937699,4937694,4937692","Overseas/Cold","gallery",[5093370,4937716,4937699,5093266,1791119,5095674,4937705,5093374,4937694,5094564,4937692,4937531]);galleries[119325]=new gallery(119325,"5552443,5552439,3218985,3097925,2957672,2957601,1798100,1788168,1785273,1784891","Overseas/Warm","gallery",[2957672,1784891,2957601,1780121,3097925,5552443,1788168,5552439,3218985,1798100,1780123,1785273]);galleries[119324]=new gallery(119324,"5816967,5816931,5263406,4954237,3602601,3216650,2945387,2468553,1784917,1783078","Awards","gallery",[5816967,5263406,4954237,3602601,2945387,2468553,1783029,1783078,1783010,3216650,1784917,5816931]);var imageSets=new Object();imageSets[1]="5934449,5816967,5299216,5095674,5093374,5093370,5093266,4937699,4937694,4937531,4085940,4066377,3914056,3836350,3612167,3581088,3568805,3568677,3568544,3568365,3446207,3375072,3375054,3374423,3373827,3373788,3244499,3244465,3220901,3220899,3219567,3216650,3123281,3122219,3097925,2468908,2468776,2257861,2211283,1827306,1827284,1791119,1788781,1788081,1787891,1784888,1784882,1783143,1780121,1779594";imageSets[3]="6180965,5956551,5934449,5816967,5816931,5681244,5552443,5552439,5491914,5299216,5280648,5263406,5095674,5095666,5094564,5093374,5093370,5093266,4954237,4937716,4937710,4937705,4937699,4937694,4937693,4937692,4937531,4085940,4066377,3914056,3837147,3836350,3765228,3641548,3622307,3612167,3602601,3598100,3597945,3581088,3568805,3568677,3568544,3568365,3446207,3413746,3375121,3375072,3375054,3374423";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/trevorrees/images";break}switch(a){case 1:b="http://www1.clikpic.com/trevorrees/images";break}switch(a){case 2:b="http://admin.clikpic.com/trevorrees/images";break}switch(a){case 24:b="http://tpc15/clikpic/trevorrees/images";break}switch(a){case 4:b="http://www.clikchurch.com/trevorrees/images";break}switch(a){case 5:b="http://www2.clikpic.com/trevorrees/images";break}switch(a){case 22:b="http://tpc5/clikpic/trevorrees/images";break}switch(a){case 23:b="http://tpc10/clikpic/trevorrees/images";break}switch(a){case 25:b="http://tpc16/clikpic/trevorrees/images";break}switch(a){case 15:b="http://www3.clikpic.com/trevorrees/images";break}switch(a){case 18:b="http://www4.clikpic.com/trevorrees/images";break}switch(a){case 19:b="http://www5.clikpic.com/trevorrees/images";break}switch(a){case 31:b="http://www7.clikpic.com/trevorrees/images";break}switch(a){case 32:b="http://admin2.clikpic.com/trevorrees/images";break}switch(a){case 33:b="http://www8.clikpic.com/trevorrees/images";break}switch(a){case 34:b="http://www9.clikpic.com/trevorrees/images";break}switch(a){case 35:b="http://admin3.clikpic.com/trevorrees/images";break}switch(a){case 37:b="http://admin4.clikpic.com/trevorrees/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="Trevor Rees 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;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>Camera </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> 							"+(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+'<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+'")'})}}};