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[2343118]=new thumbnail(2343118,"152686","Autumn Sunrise","AutumnHills_thumb.jpg",130,59,32);thumbnails[2343122]=new thumbnail(2343122,"152686","To North Hill","NorthHill_thumb.jpg",130,64,32);thumbnails[3051635]=new thumbnail(3051635,"152686","First Light On Black Hill","clikpicworcester0071_thumb.jpg",130,69,32);thumbnails[3051697]=new thumbnail(3051697,"152686","Toposcope","clikpicworcester012_thumb.jpg",130,64,32);thumbnails[2343113]=new thumbnail(2343113,"152686","British Camp","MalvernHills2_thumb.jpg",130,91,32);thumbnails[3037432]=new thumbnail(3037432,"186736","The Mill Avon","clikpic009_thumb.jpg",130,71,32);thumbnails[3054172]=new thumbnail(3054172,"152584","Spire through the Mist","img_6931a001_thumb.jpg",130,70,32);thumbnails[5256193]=new thumbnail(5256193,"295941","Severn Sunrise","clicpic_975C649D-1D09-001F-99D8FB952BBAED7D_thumb.jpg",130,77,32);thumbnails[3051555]=new thumbnail(3051555,"152686","Autumnal Hills","clikpicworcester0011_thumb.jpg",130,83,32);thumbnails[3054170]=new thumbnail(3054170,"152584","From Symond's Yat","symonds yat 7831 jpeg2005_thumb.jpg",130,80,32);thumbnails[3051172]=new thumbnail(3051172,"186747","Riverside","clikpicworcester007_thumb.jpg",130,65,32);thumbnails[3051560]=new thumbnail(3051560,"152686","From Worcester Beacon","clikpicworcester0021_thumb.jpg",130,90,32);thumbnails[3053400]=new thumbnail(3053400,"152584","River Wye Landscape","img_7823b002_thumb.jpg",130,80,32);thumbnails[3126566]=new thumbnail(3126566,"186736","Elmley Castle","upload009_thumb.jpg",130,70,32);thumbnails[2343116]=new thumbnail(2343116,"152686","A Spring Carpet","Bluebells_thumb.jpg",130,78,32);thumbnails[3053398]=new thumbnail(3053398,"152584","Kerne Bridge Landscape","clikpicworcester0052_thumb.jpg",130,86,32);thumbnails[3051144]=new thumbnail(3051144,"186747","A Break in the Storm","clikpicworcester002_thumb.jpg",130,70,32);thumbnails[3050996]=new thumbnail(3050996,"186747","Twilight","clikpicworcester019_thumb.jpg",130,68,32);thumbnails[3084641]=new thumbnail(3084641,"295941","River Teme","_mg_0054d006_thumb.jpg",130,77,32);thumbnails[3085830]=new thumbnail(3085830,"186736","Winter Scene","_mg_0136a013_thumb.jpg",130,76,32);thumbnails[3050993]=new thumbnail(3050993,"186747","The Flood","clikpicworcester017_thumb.jpg",130,81,32);thumbnails[3051561]=new thumbnail(3051561,"152686","On Worcestershire Beacon","clikpicworcester0031_thumb.jpg",130,77,32);thumbnails[3053446]=new thumbnail(3053446,"152584","Autumn Mist","clikpicworcester0042_thumb.jpg",130,83,32);thumbnails[3063759]=new thumbnail(3063759,"186736","Waterside","_mg_0039b copy002_thumb.jpg",130,78,32);thumbnails[3051601]=new thumbnail(3051601,"152686","Steps to the Hills","clikpicworcester0051_thumb.jpg",130,80,32);thumbnails[3051611]=new thumbnail(3051611,"152686","Sunbeams","clikpicworcester0061_thumb.jpg",130,87,32);thumbnails[3063754]=new thumbnail(3063754,"186736","Dusk","ap1140754a026_thumb.jpg",130,75,32);thumbnails[3084696]=new thumbnail(3084696,"186736","Croome Court","_mg_0116 copy011_thumb.jpg",130,80,32);thumbnails[3126574]=new thumbnail(3126574,"186736","Harvest","upload011_thumb.jpg",130,72,32);thumbnails[3126492]=new thumbnail(3126492,"152584","Bigsweir","upload001_thumb.jpg",130,77,32);thumbnails[3051655]=new thumbnail(3051655,"152686","Green and Gold","clikpicworcester010_thumb.jpg",130,72,32);thumbnails[3084709]=new thumbnail(3084709,"186736","Childswickham","_mg_0165b014_thumb.jpg",130,85,32);thumbnails[5254778]=new thumbnail(5254778,"186736","Croome River ","clicpic_thumb.jpg",130,81,32);thumbnails[5254795]=new thumbnail(5254795,"152584","Goodrich","clicpicphoto_thumb.jpg",130,85,32);thumbnails[3050985]=new thumbnail(3050985,"186747","Severn Reflections","clikpicworcester014_thumb.jpg",130,92,32);thumbnails[3085839]=new thumbnail(3085839,"186736","Fish Hill","aimg_5051aa020_thumb.jpg",130,79,32);thumbnails[3126570]=new thumbnail(3126570,"186736","Eckington Bridge","upload010_thumb.jpg",130,87,32);thumbnails[3084715]=new thumbnail(3084715,"186736","Spring Meadow","_mg_0051004_thumb.jpg",130,87,32);thumbnails[5256268]=new thumbnail(5256268,"295941","Lower Brockhampton","clicpic_977201A2-1D09-001F-99D57EA348ED53BB_thumb.jpg",130,84,32);thumbnails[3050990]=new thumbnail(3050990,"186747","Worcester Bridge ","clikpicworcester015_thumb.jpg",130,82,32);thumbnails[3126531]=new thumbnail(3126531,"152584","Chepstow Castle","upload004_thumb.jpg",130,70,32);thumbnails[3051155]=new thumbnail(3051155,"186747","South Quay","clikpicworcester004_thumb.jpg",130,84,32);thumbnails[3051141]=new thumbnail(3051141,"186747","Fort Royal","clikpicworcester001_thumb.jpg",130,70,32);thumbnails[3050997]=new thumbnail(3050997,"186747","Dawn ","clikpicworcester020_thumb.jpg",130,89,32);thumbnails[3051647]=new thumbnail(3051647,"152686","Little Malvern Priory","clikpicworcester008_thumb.jpg",130,90,32);thumbnails[3126544]=new thumbnail(3126544,"152584","Kerne Bridge","upload006_thumb.jpg",130,82,32);thumbnails[3051167]=new thumbnail(3051167,"186747","River Sports","clikpicworcester006_thumb.jpg",130,77,32);thumbnails[3126549]=new thumbnail(3126549,"152584","Ross-on-Wye","upload007_thumb.jpg",130,84,32);thumbnails[5043339]=new thumbnail(5043339,"186747","Worcester Quayside","WorcesterQuaysideClickpic_thumb.jpg",130,81,32);thumbnails[3051698]=new thumbnail(3051698,"152686","Evening Light","clikpicworcester013_thumb.jpg",130,92,32);thumbnails[3051699]=new thumbnail(3051699,"152686","Black Hill","clikpicworcester0141_thumb.jpg",130,98,32);thumbnails[3053457]=new thumbnail(3053457,"152584","Trees in the Mist","clikpicworcester0032_thumb.jpg",87,130,32);thumbnails[3085824]=new thumbnail(3085824,"295941","River Severn","img_6798hdr031_thumb.jpg",86,130,32);thumbnails[3085874]=new thumbnail(3085874,"152686","Firey Sky","ap1140693025_thumb.jpg",98,130,32);thumbnails[2343111]=new thumbnail(2343111,"152686","Malvern Evening","MalvernHills1_thumb.jpg",130,165,32);thumbnails[3054169]=new thumbnail(3054169,"152584","River Wye Portrait","img_7835a004_thumb.jpg",102,130,32);thumbnails[3126540]=new thumbnail(3126540,"152584","The Wye Bridge","upload005_thumb.jpg",91,130,32);thumbnails[3085854]=new thumbnail(3085854,"186736","Croome Evening","ap1060948021_thumb.jpg",130,86,32);thumbnails[3126526]=new thumbnail(3126526,"152584","Toll Bridge","upload002_thumb.jpg",95,130,32);thumbnails[3126556]=new thumbnail(3126556,"152584","Ross Reflected","upload008_thumb.jpg",98,130,32);thumbnails[2341514]=new thumbnail(2341514,"152584","Kerne Bridge","kerneclickpic_thumb.jpg",130,195,32);thumbnails[3037437]=new thumbnail(3037437,"186736","Abel Fletcher's Mill","clikpic011_thumb.jpg",130,87,32);thumbnails[3084614]=new thumbnail(3084614,"186736","Croome d'Abitot ","_mg_0043 (2)003_thumb.jpg",130,87,32);thumbnails[3085869]=new thumbnail(3085869,"186736","Crookbarrow","ap1140446024_thumb.jpg",130,98,32);thumbnails[3084677]=new thumbnail(3084677,"186736","Abbey Gateway","_mg_0080b010_thumb.jpg",87,130,32);thumbnails[3051151]=new thumbnail(3051151,"186747","Glover's Needle","clikpicworcester003_thumb.jpg",130,183,32);thumbnails[5256223]=new thumbnail(5256223,"186736","Flying the Flag","clicpic_976869A4-1D09-001F-9995399402828569_thumb.jpg",130,91,32);thumbnails[3085876]=new thumbnail(3085876,"186736","Upton-upon-Severn","ap1160906a027_thumb.jpg",115,130,32);thumbnails[3085860]=new thumbnail(3085860,"186736","Croome Court","_mg_0006 copy001_thumb.jpg",103,130,32);thumbnails[3084600]=new thumbnail(3084600,"186736","The Three Towers","three towers 1170736 jpeg032_thumb.jpg",99,130,32);thumbnails[3084700]=new thumbnail(3084700,"186736","Croome Church: Winter","_mg_0118a012_thumb.jpg",94,130,32);thumbnails[5256213]=new thumbnail(5256213,"186736","Twilight","clicpic2_thumb.jpg",98,130,32);thumbnails[3084648]=new thumbnail(3084648,"186736","The Bell Tower","clicpic_9760A135-1D09-001F-9919F989538E1C7A_thumb.jpg",93,130,32);thumbnails[3084707]=new thumbnail(3084707,"186736","Pershore Abbey","_mg_0169a015_thumb.jpg",94,130,32);thumbnails[3037433]=new thumbnail(3037433,"186736","The Abbey and the Mill","clikpic010_thumb.jpg",130,183,32);thumbnails[3050994]=new thumbnail(3050994,"186747","Cathedral","clikpicworcester018_thumb.jpg",130,185,32);thumbnails[3051162]=new thumbnail(3051162,"186747","Worcester Bridge","clikpicworcester005_thumb.jpg",130,174,32);thumbnails[5256357]=new thumbnail(5256357,"186736","On Croome River","clicpic_977843EE-1D09-001F-99A6D2A7096638AE_thumb.jpg",130,130,32);thumbnails[5300199]=new thumbnail(5300199,"295941","Crookbarrow Hill","clicpic_DBE4EAAF-1D09-001F-9948D4147EC041D8_thumb.jpg",98,130,32);thumbnails[2343105]=new thumbnail(2343105,"152574","Across the Rack Isle","ArlingtonRow_thumb.jpg",130,68,32);thumbnails[3035062]=new thumbnail(3035062,"152574","Bourton on the Hill","clikpic001_thumb.jpg",130,75,32);thumbnails[3035078]=new thumbnail(3035078,"152574","Snowshill Church","clikpic004_thumb.jpg",130,73,32);thumbnails[3037507]=new thumbnail(3037507,"152574","Windrush Valley","clikpic017_thumb.jpg",130,87,32);thumbnails[3037445]=new thumbnail(3037445,"152574","Westonbirt","clikpic013_thumb.jpg",130,98,32);thumbnails[2343168]=new thumbnail(2343168,"152574","Across the Coneygree","CampdenManor_thumb.jpg",130,85,32);thumbnails[3084664]=new thumbnail(3084664,"152574","A Winter's Day","_mg_0066 copy008_thumb.jpg",130,83,32);thumbnails[3035072]=new thumbnail(3035072,"152574","Snowshill Lavender Fields","clikpic003_thumb.jpg",130,80,32);thumbnails[3037447]=new thumbnail(3037447,"152574","Arlington Mill Stream","clikpic014_thumb.jpg",130,90,32);thumbnails[3035070]=new thumbnail(3035070,"152574","Duntisbourne Rouse","clikpic002_thumb.jpg",130,86,32);thumbnails[3037414]=new thumbnail(3037414,"152574","Old Campden Manor","clikpic008_thumb.jpg",130,78,32);thumbnails[3035088]=new thumbnail(3035088,"152574","Cottages on Broadwway Road, Snowshill","clikpic006_thumb.jpg",130,80,32);thumbnails[3037368]=new thumbnail(3037368,"152574","Winchcombe","clikpic007_thumb.jpg",130,80,32);thumbnails[3084624]=new thumbnail(3084624,"152574","Broadway Tower","_mg_0054 copy005_thumb.jpg",92,130,32);thumbnails[3085845]=new thumbnail(3085845,"152574","Broadway Tower","aimg_3788a018_thumb.jpg",87,130,32);thumbnails[3037452]=new thumbnail(3037452,"152574","The Cross, Stow on the Wold.","clikpic015_thumb.jpg",130,133,32);thumbnails[2341451]=new thumbnail(2341451,"152574","Windrush Valley","clikpic016_thumb.jpg",130,180,32);thumbnails[3035081]=new thumbnail(3035081,"152574","St. Mary's, Batsford","clikpic005_thumb.jpg",130,184,32);thumbnails[2343132]=new thumbnail(2343132,"152574","The Mill on the Eye","MillontheEye_thumb.jpg",130,195,32);thumbnails[3037440]=new thumbnail(3037440,"152574","Didbrook, Gloucestershire","clikpic012_thumb.jpg",130,196,32);var galleries=new Object();galleries[152686]=new gallery(152686,"2343111","Malvern Hills","gallery",[2343118,2343122,3051635,3051697,2343113,3051555,3051560,2343116,3051561,3051601,3051611,3051655,3051647,3051698,3051699,3085874,2343111]);galleries[186736]=new gallery(186736,"3037433","Vale of Evesham","gallery",[3037432,3126566,3085830,3063759,3063754,3084696,3126574,3084709,5254778,3085839,3126570,3084715,3085854,3037437,3084614,3085869,3084677,5256223,3085876,3085860,3084600,3084700,5256213,3084648,3084707,3037433,5256357]);galleries[186747]=new gallery(186747,"3050994","Worcester","gallery",[3051172,3051144,3050996,3050993,3050985,3050990,3051155,3051141,3050997,3051167,5043339,3051151,3050994,3051162]);galleries[295941]=new gallery(295941,"5300199,5256268,5256193,3085824,3084641","Worcestershire","gallery",[5256193,3084641,5256268,3085824,5300199]);galleries[152584]=new gallery(152584,"3054169,2341514","Wye Valley","gallery",[3054172,3054170,3053400,3053398,3053446,3126492,5254795,3126531,3126544,3126549,3053457,3054169,3126540,3126526,3126556,2341514]);galleries[152574]=new gallery(152574,"2343132,2341451","Cotswold Hills","gallery",[2343105,3035062,3035078,3037507,3037445,2343168,3084664,3035072,3037447,3035070,3037414,3035088,3037368,3084624,3085845,3037452,2341451,3035081,2343132,3037440]);var imageSets=new Object();imageSets[1]="5043339,3084614,3051601,3051144,3037445,3035070";imageSets[2]="3054169,3050994,3037433,2343132,2343111,2341514,2341451";imageSets[3]="5300199,5256357,5256268,5256223,5256213,5256193,5254795,5254778,5043339,3126574,3126570,3126566,3126556,3126549,3126544,3126540,3126531,3126526,3126492,3085876,3085874,3085869,3085860,3085854,3085845,3085839,3085830,3085824,3084715,3084709,3084707,3084700,3084696,3084677,3084664,3084648,3084641,3084624,3084614,3084600,3063759,3063754,3054172,3054170,3054169,3053457,3053446,3053400,3053398,3051699";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/flashoflight/images";break}switch(a){case 1:b="http://www1.clikpic.com/flashoflight/images";break}switch(a){case 2:b="http://admin.clikpic.com/flashoflight/images";break}switch(a){case 4:b="http://www.clikchurch.com/flashoflight/images";break}switch(a){case 5:b="http://www2.clikpic.com/flashoflight/images";break}switch(a){case 15:b="http://www3.clikpic.com/flashoflight/images";break}switch(a){case 21:b="http://www6.clikpic.com/flashoflight/images";break}switch(a){case 18:b="http://www4.clikpic.com/flashoflight/images";break}switch(a){case 19:b="http://www5.clikpic.com/flashoflight/images";break}switch(a){case 22:b="http://tpc5/clikpic/flashoflight/images";break}switch(a){case 23:b="http://tpc10/clikpic/flashoflight/images";break}switch(a){case 24:b="http://tpc15/clikpic/flashoflight/images";break}switch(a){case 25:b="http://tpc16/clikpic/flashoflight/images";break}switch(a){case 31:b="http://www7.clikpic.com/flashoflight/images";break}switch(a){case 32:b="http://admin2.clikpic.com/flashoflight/images";break}switch(a){case 33:b="http://www8.clikpic.com/flashoflight/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="Three Counties 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>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> 							"+(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+'")'})}}};