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[6520519]=new thumbnail(6520519,"","","_MG_6828_thumb.jpg",130,87,32);thumbnails[3277992]=new thumbnail(3277992,"349365","Preparing for the big event","_MG_6439-Edit_thumb.jpg",130,87,32);thumbnails[4990577]=new thumbnail(4990577,"349365","Expectation","_MG_0266_thumb.jpg",68,130,32);thumbnails[4990587]=new thumbnail(4990587,"349365","Expectation II","_MG_0291_thumb.jpg",87,130,32);thumbnails[5108867]=new thumbnail(5108867,"349365","Celebration","_MG_6498-Edit_thumb.jpg",130,130,32);thumbnails[5108869]=new thumbnail(5108869,"349365","","_MG_6512-Edit_thumb.jpg",87,130,32);thumbnails[6372455]=new thumbnail(6372455,"349365","","_MG_4684_thumb.jpg",87,130,32);thumbnails[6372458]=new thumbnail(6372458,"349365","After the Dance","_MG_5063-Edit_thumb.jpg",130,87,32);thumbnails[6372460]=new thumbnail(6372460,"349365","","_MG_1626_thumb.jpg",85,130,32);thumbnails[6372465]=new thumbnail(6372465,"349365","","_MG_4806-Edit_thumb.jpg",130,109,32);thumbnails[6372469]=new thumbnail(6372469,"349365","","_MG_2815-Edit_thumb.jpg",130,87,32);thumbnails[6372483]=new thumbnail(6372483,"349365","","_MG_2803-Edit_thumb.jpg",130,87,32);thumbnails[6372495]=new thumbnail(6372495,"349365","","_MG_0419_thumb.jpg",87,130,32);thumbnails[6390265]=new thumbnail(6390265,"349365","","_MG_4841_thumb.jpg",104,130,32);thumbnails[3669195]=new thumbnail(3669195,"173530","The Doon","_MG_7670_thumb.jpg",130,130,32);thumbnails[5049863]=new thumbnail(5049863,"173530","Marvin's Boat","IMG_3549_7_8_thumb.jpg",87,130,32);thumbnails[5071765]=new thumbnail(5071765,"173530","Sunset, Lochranza","Lochranza_pano2-22_thumb.jpg",130,33,32);thumbnails[5107520]=new thumbnail(5107520,"173530","Fallen Gold","_MG_0801_799_800_thumb.jpg",87,130,32);thumbnails[5703198]=new thumbnail(5703198,"173530","Holy Isle Sunset","_MG_1900_1_2_thumb.jpg",130,87,32);thumbnails[3421534]=new thumbnail(3421534,"173530","Windchill","_MG_7334_thumb.jpg",130,130,32);thumbnails[3125977]=new thumbnail(3125977,"173530","Hidden Pool","Untitled_HDR22_thumb.jpg",130,173,32);thumbnails[3107416]=new thumbnail(3107416,"173530","Tickets Please","_MG_5652_0_1_thumb.jpg",130,87,32);thumbnails[3511093]=new thumbnail(3511093,"173530","Green & Gold","_MG_6032_3_4_thumb.jpg",130,130,32);thumbnails[3107063]=new thumbnail(3107063,"173530","Wet Feet","Blackwaterfoot beach-57372_thumb.jpg",130,155,32);thumbnails[3511128]=new thumbnail(3511128,"173530","Icy Calm","_MG_6239_7_8_thumb.jpg",130,98,32);thumbnails[3107425]=new thumbnail(3107425,"173530","","Blackwaterfoot beach02_thumb.jpg",130,87,32);thumbnails[3104969]=new thumbnail(3104969,"173530","Angry Sea","IMG_4562_thumb.jpg",130,87,32);thumbnails[3104967]=new thumbnail(3104967,"173530","Marvin's Boat II","IMG_3558_6_7_thumb.jpg",130,87,32);thumbnails[3104975]=new thumbnail(3104975,"173530","Sawmill","Sawmill02_thumb.jpg",130,41,32);thumbnails[3106903]=new thumbnail(3106903,"173530","Barnacles","Barnacles_thumb.jpg",130,173,32);thumbnails[3107058]=new thumbnail(3107058,"173530","Violet Dawn","_MG_56941_thumb.jpg",130,195,32);thumbnails[3397016]=new thumbnail(3397016,"190556","Metropolis","Untitled_Panorama1_thumb.jpg",130,49,32);thumbnails[3397026]=new thumbnail(3397026,"190556","Juxtaposition","_MG_7275_thumb.jpg",130,130,32);thumbnails[3397029]=new thumbnail(3397029,"190556","Ancient & Modern","_MG_7254_thumb.jpg",86,130,32);thumbnails[3278005]=new thumbnail(3278005,"190556","Clydeside","Untitled_Panorama3-Edit_thumb.jpg",130,48,32);thumbnails[4555965]=new thumbnail(4555965,"190556","St Rule's Tower","_MG_9576_7_8_thumb.jpg",86,130,32);thumbnails[4556020]=new thumbnail(4556020,"190556","Lighthouse, Anstruther","_MG_9742_thumb.jpg",87,130,32);thumbnails[4556021]=new thumbnail(4556021,"190556","Crail","_MG_9745_6_7_thumb.jpg",95,130,32);thumbnails[4990580]=new thumbnail(4990580,"190556","Star trails","_MG_0831_thumb.jpg",130,87,32);thumbnails[3104957]=new thumbnail(3104957,"190556","Girl Claire","Girl Claire_thumb.jpg",130,73,32);thumbnails[3104667]=new thumbnail(3104667,"190556","Slurp","Slurp_thumb.jpg",130,94,32);thumbnails[3107144]=new thumbnail(3107144,"190556","","Pittenweem - Lundin Links-5003_thumb.jpg",130,195,32);thumbnails[3104938]=new thumbnail(3104938,"190556","Incredible Hulks","Incredible Hulks_thumb.jpg",130,52,32);thumbnails[3104984]=new thumbnail(3104984,"190556","Pittenweem Harbour","Pittenweem - Lundin Links-4951_thumb.jpg",130,98,32);thumbnails[3128626]=new thumbnail(3128626,"173531","Pulses","20070920_132_thumb.jpg",130,87,32);thumbnails[3422040]=new thumbnail(3422040,"173531","Lagoon","IMG_1519_thumb.jpg",87,130,32);thumbnails[3835564]=new thumbnail(3835564,"173531","Victorian Recycling","_MG_8058_59_60_thumb.jpg",130,107,32);thumbnails[3835583]=new thumbnail(3835583,"173531","Lindisfarne Castle","_MG_8092_3_4_thumb.jpg",130,87,32);thumbnails[4899691]=new thumbnail(4899691,"173531","Hawkshead ","Hawkshead_pano_thumb.jpg",130,44,32);thumbnails[5108876]=new thumbnail(5108876,"173531","Pier into the distance","_MG_1219_20_21_thumb.jpg",130,130,32);thumbnails[5933675]=new thumbnail(5933675,"173531","Duomo Nuovo","_MG_3444_5_6-Edit_thumb.jpg",125,130,32);thumbnails[5933693]=new thumbnail(5933693,"173531","Basilica San Marco","_MG_3653_tonemapped_thumb.jpg",88,130,32);thumbnails[5933701]=new thumbnail(5933701,"173531","Basilica Salute","_MG_3674_5_6_thumb.jpg",87,130,32);thumbnails[5933706]=new thumbnail(5933706,"173531","Piazza San Marco pigeons","_MG_3592_thumb.jpg",130,87,32);thumbnails[3107429]=new thumbnail(3107429,"173531","Family Transport","Indo Biker_thumb.jpg",130,128,32);thumbnails[3104963]=new thumbnail(3104963,"173531","Three boys","IMG_1776_thumb.jpg",130,87,32);thumbnails[3107436]=new thumbnail(3107436,"173531","Balinese Fish","Indofish_thumb.jpg",130,98,32);thumbnails[3125940]=new thumbnail(3125940,"173531","Ponte del Diavolo ","Bridge01_thumb.jpg",130,87,32);thumbnails[3104869]=new thumbnail(3104869,"173531","Evening Catch","Evening Catch_thumb.jpg",130,87,32);thumbnails[3107427]=new thumbnail(3107427,"173531","Crumbling Grandeur","Hotel_thumb.jpg",130,92,32);thumbnails[3107445]=new thumbnail(3107445,"173531","Alpine Dawn","Switz01_thumb.jpg",130,88,32);thumbnails[3107397]=new thumbnail(3107397,"173531","Red and Blue","IMG_0998_thumb.jpg",130,87,32);thumbnails[3104978]=new thumbnail(3104978,"173531","Multi-tasking","IMG_1700_thumb.jpg",130,87,32);thumbnails[4556055]=new thumbnail(4556055,"190551","VeeDub","_MG_9505_thumb.jpg",130,87,32);thumbnails[5933683]=new thumbnail(5933683,"190551","Street Rod","_MG_3478_thumb.jpg",87,130,32);thumbnails[6520527]=new thumbnail(6520527,"190551","","_MG_6820_thumb.jpg",130,87,32);thumbnails[6520535]=new thumbnail(6520535,"190551","","_MG_6800_thumb.jpg",130,96,32);thumbnails[3125971]=new thumbnail(3125971,"190551","900SS","IMG_3604_thumb.jpg",130,87,32);thumbnails[3107170]=new thumbnail(3107170,"190551","Moto 6'5","Motob-w_thumb.jpg",130,199,32);thumbnails[3106943]=new thumbnail(3106943,"190551","'Green' Car","2CV2_thumb.jpg",130,195,32);thumbnails[3107156]=new thumbnail(3107156,"190551","Motobecane","Motobecane1_thumb.jpg",130,168,32);thumbnails[3107388]=new thumbnail(3107388,"190551","Crossers","Crossers01_thumb.jpg",130,86,32);thumbnails[5108897]=new thumbnail(5108897,"190725","Buttermere Church","_MG_1273_1_2_thumb.jpg",130,87,32);thumbnails[5703203]=new thumbnail(5703203,"190725","Nardini's","_MG_1373_4_5_thumb.jpg",130,62,32);thumbnails[5933668]=new thumbnail(5933668,"190725","Menaggio","_MG_3404_tonemapped_thumb.jpg",130,65,32);thumbnails[3107353]=new thumbnail(3107353,"190725","Standing Stones","standing stones2_thumb.jpg",130,74,32);thumbnails[3125950]=new thumbnail(3125950,"190725","Jones's","Buckie Shipyards_thumb.jpg",130,98,32);thumbnails[3125922]=new thumbnail(3125922,"190725","Ashton Memorial","Ashton Memorial_thumb.jpg",130,190,32);thumbnails[3107242]=new thumbnail(3107242,"190725","Bandit Country","Sawmill03_thumb.jpg",130,41,32);thumbnails[3125947]=new thumbnail(3125947,"190725","Creels","Gardenstoun_thumb.jpg",130,98,32);thumbnails[3125984]=new thumbnail(3125984,"190725","Spooky trees","Jenny Browns Point_thumb.jpg",130,86,32);thumbnails[3128619]=new thumbnail(3128619,"191823","Shopping","20070920_037_thumb.jpg",130,195,32);thumbnails[3128625]=new thumbnail(3128625,"191823","Prep","20070920_062_thumb.jpg",130,195,32);thumbnails[3128642]=new thumbnail(3128642,"191823","Two of those please","_MG_5976_thumb.jpg",130,195,32);thumbnails[3277998]=new thumbnail(3277998,"191823","Capturing Fire and Ice","_MG_6958_thumb.jpg",130,87,32);thumbnails[5933679]=new thumbnail(5933679,"191823","Lovers","_MG_3456_thumb.jpg",130,87,32);thumbnails[5933697]=new thumbnail(5933697,"191823","Sleeping Gondolier","_MG_3555-Edit_thumb.jpg",90,130,32);var galleries=new Object();galleries[349365]=new gallery(349365,"6390265,6372495,6372483,6372469,6372465,6372460,6372458,6372455,5108869,5108867","Wedding and Portrait","gallery",[3277992,4990577,4990587,5108867,5108869,6372455,6372458,6372460,6372465,6372469,6372483,6372495,6390265]);galleries[173530]=new gallery(173530,"3669195,3107425,3107058,3106903,3104969,3104967","Arran","gallery",[3669195,5049863,5071765,5107520,5703198,3421534,3125977,3107416,3511093,3107063,3511128,3107425,3104969,3104967,3104975,3106903,3107058]);galleries[190556]=new gallery(190556,"3397029,3397026,3278005,3107144,3104984","Scotland","gallery",[3397016,3397026,3397029,3278005,4555965,4556020,4556021,4990580,3104957,3104667,3107144,3104938,3104984]);galleries[173531]=new gallery(173531,"3835583,3835564,3422040,3128626,3125940,3107445,3107429,3104978,3104963,3104869","Travel","gallery",[3128626,3422040,3835564,3835583,4899691,5108876,5933675,5933693,5933701,5933706,3107429,3104963,3107436,3125940,3104869,3107427,3107445,3107397,3104978]);galleries[190551]=new gallery(190551,"3125971,3107388,3107170,3107156,3106943","Auto/Moto","gallery",[4556055,5933683,6520527,6520535,3125971,3107170,3106943,3107156,3107388]);galleries[190725]=new gallery(190725,"3125984,3125950,3125922,3107353","Monochrome","gallery",[5108897,5703203,5933668,3107353,3125950,3125922,3107242,3125947,3125984]);galleries[191823]=new gallery(191823,"3128642,3128625,3128619","People","gallery",[3128619,3128625,3128642,3277998,5933679,5933697]);var imageSets=new Object();imageSets[1]="3835583,3835564,3669195,3422040,3421534,3397029,3397026,3397016,3278005,3277998,3128642,3128626,3128625,3128619,3125984,3125977,3125971,3125950,3125940,3125922,3107445,3107436,3107429,3107427,3107425,3107416,3107397,3107388,3107353,3107170,3107156,3107144,3107063,3107058,3106943,3106903,3104984,3104978,3104969,3104967,3104963,3104957,3104869,3104667";imageSets[2]="3835583,3835564,3669195,3422040,3397029,3397026,3278005,3128642,3128626,3128625,3128619,3125984,3125971,3125950,3125940,3125922,3107445,3107429,3107425,3107388,3107353,3107170,3107156,3107144,3107058,3106943,3106903,3104984,3104978,3104969,3104967,3104963,3104869";imageSets[3]="6520535,6520527,6520519,6390265,6372495,6372483,6372469,6372465,6372460,6372458,6372455,5933706,5933701,5933697,5933693,5933683,5933679,5933675,5933668,5703203,5703198,5108897,5108876,5108869,5108867,5107520,5071765,5049863,4990587,4990580,4990577,4899691,4556055,4556021,4556020,4555965,3835583,3835564,3669195,3511128,3511093,3422040,3421534,3397029,3397026,3397016,3278005,3277998,3277992,3128642";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/andy_tuf/images";break}switch(a){case 1:b="http://www1.clikpic.com/andy_tuf/images";break}switch(a){case 2:b="http://admin.clikpic.com/andy_tuf/images";break}switch(a){case 24:b="http://tpc15/clikpic/andy_tuf/images";break}switch(a){case 4:b="http://www.clikchurch.com/andy_tuf/images";break}switch(a){case 5:b="http://www2.clikpic.com/andy_tuf/images";break}switch(a){case 22:b="http://tpc5/clikpic/andy_tuf/images";break}switch(a){case 23:b="http://tpc10/clikpic/andy_tuf/images";break}switch(a){case 25:b="http://tpc16/clikpic/andy_tuf/images";break}switch(a){case 15:b="http://www3.clikpic.com/andy_tuf/images";break}switch(a){case 18:b="http://www4.clikpic.com/andy_tuf/images";break}switch(a){case 19:b="http://www5.clikpic.com/andy_tuf/images";break}switch(a){case 31:b="http://www7.clikpic.com/andy_tuf/images";break}switch(a){case 32:b="http://admin2.clikpic.com/andy_tuf/images";break}switch(a){case 33:b="http://www8.clikpic.com/andy_tuf/images";break}switch(a){case 34:b="http://www9.clikpic.com/andy_tuf/images";break}switch(a){case 35:b="http://admin3.clikpic.com/andy_tuf/images";break}switch(a){case 37:b="http://admin4.clikpic.com/andy_tuf/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="Arran Images ANDREW SURRIDGE 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>"}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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';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">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="ANDY_TUF">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";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+'")'})}}};