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[6337465]=new thumbnail(6337465,"343467","Confetti in Her Hair","GD061_thumb.jpg",130,86,32);thumbnails[3180306]=new thumbnail(3180306,"343467","Traquair House Wedding","Wedding In Grounds of Traquiair1_thumb.jpg",130,96,32);thumbnails[3958074]=new thumbnail(3958074,"343467","Joe & Nicky Mulchrone Share a laugh after their wedding ceremony ","Blossom_6_Web_thumb.jpg",130,168,32);thumbnails[6337589]=new thumbnail(6337589,"343467","During the Ceremony","O__D_69_thumb.jpg",130,86,32);thumbnails[6337605]=new thumbnail(6337605,"343467","After the Ceremony","O__D_102_thumb.jpg",130,86,32);thumbnails[2317820]=new thumbnail(2317820,"343467","The Kiss","CNV00007-1_thumb.JPG",130,192,32);thumbnails[2406025]=new thumbnail(2406025,"","Mick Jagger at Dartford Grammar School In 2000","Mick-Jagger-at-Dartford-School_thumb.jpg",130,87,32);thumbnails[2317792]=new thumbnail(2317792,"343467","Mark Davey working at a wedding","A & N 11A_thumb.jpg",130,89,32);thumbnails[2405575]=new thumbnail(2405575,"343467","Father of the Bride's Speech","Wedding-Speech_thumb.jpg",130,88,32);thumbnails[3958080]=new thumbnail(3958080,"151453","Nicky Heraty is escorted to Traquair House chapel by Bruce the Piper","Piping_to_Chapel_2_web_thumb.jpg",130,78,32);thumbnails[3958088]=new thumbnail(3958088,"151453","Joe & Nicky Mulchrone enjoy a drink with Father John after their wedding ceremony","Toast_4_web1_thumb.jpg",130,100,32);thumbnails[5135244]=new thumbnail(5135244,"151453","Shannon & Kevin Pisarsky celebrate their wedding & Hallowe'en at Traquair (Scotland's oldest inhabited house)","Traquair_Halloween_Wedding_thumb.jpg",130,185,32);thumbnails[2393157]=new thumbnail(2393157,"151453","Bride's Laughter","DSC_1075_thumb.jpg",130,195,32);thumbnails[2405571]=new thumbnail(2405571,"151453","Confetti Collector","Confetti-collector_thumb.jpg",130,130,32);thumbnails[2317803]=new thumbnail(2317803,"151453","In the Rain","DSC_1043_thumb.jpg",130,195,32);thumbnails[2393143]=new thumbnail(2393143,"151453","Ning and Andrew Smart Family Group","DSC_1028_thumb.jpg",130,87,32);thumbnails[2393132]=new thumbnail(2393132,"151453","Look at the ring","A & N 6A1_thumb.jpg",130,187,32);thumbnails[2317796]=new thumbnail(2317796,"151453","Mark Davey being filmed by ITV Border while working at a wedding","A & N 12A_thumb.jpg",130,96,32);thumbnails[2405630]=new thumbnail(2405630,"151453","Bride's Laugh","Laughing-Bride_thumb.jpg",130,109,32);thumbnails[2405637]=new thumbnail(2405637,"151453","Wedding Group outside Peebles Parish Church","Wedding-Group-1_thumb.jpg",130,86,32);thumbnails[2405639]=new thumbnail(2405639,"151453","Smile for the Camera Please","Smile_thumb.jpg",130,163,32);thumbnails[5135013]=new thumbnail(5135013,"151453","Lianne Middlemiss on her wedding day in August 2009","LD_0109_thumb.jpg",130,173,32);thumbnails[5135076]=new thumbnail(5135076,"151453","Lianne & Derrick Middlemiss buying ice-creams on their wedding day","LD_0124_thumb.jpg",130,182,32);thumbnails[5135087]=new thumbnail(5135087,"151453","Signing the register","LD_0020_thumb.jpg",130,195,32);thumbnails[2393153]=new thumbnail(2393153,"151453","Andrew and Ning Smart","DSC_1072_thumb.jpg",130,195,32);thumbnails[5135100]=new thumbnail(5135100,"151453","Chewin' The Fat","LD_0079_thumb.jpg",130,173,32);thumbnails[5135110]=new thumbnail(5135110,"151453","The Groom & Best Man in Gardens near Coldstream Registry Office","LD_0052_thumb.jpg",130,98,32);thumbnails[5135255]=new thumbnail(5135255,"151453","Shannon Pisarsky signs the register at Traquair House ","Shannon_for_clik_thumb.jpg",130,86,32);thumbnails[5135259]=new thumbnail(5135259,"151453","Cupid's Garden","Shannon__Kevin_Pisarsky_at_Traquair_thumb.jpg",130,96,32);thumbnails[2393187]=new thumbnail(2393187,"151606","Bumblebee on Geranium 2","Bumblebee-on-Geranium_thumb.jpg",130,93,32);thumbnails[2393190]=new thumbnail(2393190,"151606","Lupin","Delphinium_thumb.jpg",130,195,32);thumbnails[2393197]=new thumbnail(2393197,"151606","White Peony","Peony-1_thumb.jpg",130,130,32);thumbnails[2393198]=new thumbnail(2393198,"151606","White Peony Black and White","Peony-b&w_thumb.jpg",130,130,32);thumbnails[2393206]=new thumbnail(2393206,"151606","Red Peony","Red-Peony-Rose_thumb.jpg",130,87,32);thumbnails[2393183]=new thumbnail(2393183,"151606","Bumble bee on Geranium","Bumblebee-2-on-Geranium_thumb.jpg",130,87,32);thumbnails[2393195]=new thumbnail(2393195,"151606","Magenta Ox-eye-daisy","Magenta-Ox-eye-Daisy_thumb.jpg",130,80,32);thumbnails[2417505]=new thumbnail(2417505,"151606","Four Primulas","Four-Primulas_thumb.jpg",130,87,32);thumbnails[2662991]=new thumbnail(2662991,"155292","James Moore in Time Trial Action","10mtt-11_thumb.jpg",130,73,32);thumbnails[2394019]=new thumbnail(2394019,"155292","2007 Tour de France Riders on Champs Elysees Paris","Tour-riders-on-Champs-Elysees-2007_thumb.jpg",130,37,32);thumbnails[2394022]=new thumbnail(2394022,"155292","Alberto Contador","Alberto-Contador_thumb.jpg",130,87,32);thumbnails[2394024]=new thumbnail(2394024,"155292","Tour de France Panorama","Tour-de-France-Panorama_thumb.jpg",130,53,32);thumbnails[3848239]=new thumbnail(3848239,"155292","Broken Ultegra Crank","Broken_Crank_1_web_thumb.jpg",130,100,32);thumbnails[2317812]=new thumbnail(2317812,"151452","Am Bhasteir and Sgurr Nan Gillian, Black Cuillin Isle of Skye","Am-Basteir-&-Sgurr-Nan-Gillean_thumb.jpg",130,98,32);thumbnails[2317817]=new thumbnail(2317817,"151452","Afternoon cloud on Glamaig","Glamaig-with-Afternon-Cloud_thumb.jpg",130,98,32);thumbnails[2393552]=new thumbnail(2393552,"151452","Rainbow above Glenbrittle","Rainbow-above-Glenbrittle_thumb.jpg",130,174,32);thumbnails[2393556]=new thumbnail(2393556,"151452","Sgurr Alasdair through a Rainbow","Sgurr-Alasdair-through-a-rainbow_thumb.jpg",130,97,32);thumbnails[2417454]=new thumbnail(2417454,"151452","Glamaig","Glamaig-3_thumb.jpg",130,98,32);thumbnails[2417484]=new thumbnail(2417484,"151452","Ruth Beach Taking Photographs from Bruach Na Frith Black Cuillin Isle of Skye","Ruth-Beach-taking-pictures-on-Bruach-Na-Frith_thumb.jpg",130,98,32);thumbnails[3438398]=new thumbnail(3438398,"151604","Cairngorm Panorama","Cairngorm Panorama from Carn an Tuirc cp_thumb.jpg",130,44,32);thumbnails[2321559]=new thumbnail(2321559,"151604","","On-route-to-Beinn-Ghlas_thumb.jpg",130,87,32);thumbnails[2321562]=new thumbnail(2321562,"151604","Bheinn Ghlas, Tayside, Scotland","On-the-Way-to-Beinn-Ghlas_thumb.jpg",130,196,32);thumbnails[3180286]=new thumbnail(3180286,"151604","Sunsets on Ben More & Stob Binnein","Ben More & Stob Binneinn_thumb.jpg",130,53,32);thumbnails[2661961]=new thumbnail(2661961,"155859","Cycle Racer in action","10mtt-21_thumb.jpg",130,88,32);thumbnails[3958035]=new thumbnail(3958035,"155859","Eventing at Floors Castle ","M_3_web_thumb.jpg",130,132,32);thumbnails[3958036]=new thumbnail(3958036,"155859","Eventing at Floors Castle","M_16_web1_thumb.jpg",130,86,32);thumbnails[3958039]=new thumbnail(3958039,"155859","Eventing at Floors Castle 3","M_19_web_thumb.jpg",130,104,32);thumbnails[3958041]=new thumbnail(3958041,"155859","Eventing at Floors 4","M_21_web1_thumb.jpg",130,86,32);thumbnails[4013792]=new thumbnail(4013792,"155859","Wing Walkers at the East Fortune Airshow in 2008","Wingwalkers_1_web_thumb.jpg",130,86,32);thumbnails[2405911]=new thumbnail(2405911,"155859","Peebles Rugby Lineout","Autumn-Lineout-web_thumb.jpg",130,124,32);thumbnails[2405913]=new thumbnail(2405913,"155859","Damon Hill in 1996","Damon-Hill-Portrait_thumb.jpg",130,130,32);thumbnails[2405966]=new thumbnail(2405966,"155859","Triathlete Laura Tingley in the Pool","Swimmer[1]_thumb.jpg",130,97,32);thumbnails[2405971]=new thumbnail(2405971,"155859","Anna Davey Showjumping on Tod","Anna-Jumping-1_thumb.jpg",130,195,32);thumbnails[2405972]=new thumbnail(2405972,"155859","Action from a Peebles Cycling Club Time Trial","Soutter-&-Brindley_thumb.jpg",130,98,32);thumbnails[3438383]=new thumbnail(3438383,"155859","Superbikes Skidaddle","Superbikes cp_thumb.jpg",130,61,32);thumbnails[3438349]=new thumbnail(3438349,"155866","Carving Stone at Traquair Fair<br>\r\n","Stone Carving cp_thumb.jpg",130,181,32);thumbnails[3565904]=new thumbnail(3565904,"155866","Using fast moving traffic on the Eddleston straight near Peebles to teach the basics of motorsport photography. Fraser gets to grips with shutter speeds.","During_a_Lesson_on_Motorsport_Photography_web_thumb.jpg",130,87,32);thumbnails[4013808]=new thumbnail(4013808,"155866","Aperture Notes on Depth of Field","Aperture__Depth_of_Field_web_thumb.jpg",130,184,32);thumbnails[2406038]=new thumbnail(2406038,"155866","Shutter Speeds and the Effect on Movement","Shutter-Speeds_thumb.jpg",130,195,32);thumbnails[2406266]=new thumbnail(2406266,"155866","Night Scene Photography including fireworks","Night-Scenes-for-web_thumb.jpg",130,92,32);thumbnails[2406269]=new thumbnail(2406269,"155866","White Balance ","White-Balance-Notes_thumb.jpg",130,87,32);thumbnails[2602294]=new thumbnail(2602294,"165440","Lotus Elan","Lotus-Elan-1_thumb.jpg",130,60,32);thumbnails[2602299]=new thumbnail(2602299,"165440","Alvis 4.3 Litre 1938","Fred-Multon-in-his-Alvis_thumb.jpg",130,59,32);thumbnails[2602302]=new thumbnail(2602302,"165440","Bentley MkVI","He-drives-it-like-he's-stolen-it_thumb.............jpg",130,63,32);thumbnails[2602348]=new thumbnail(2602348,"165440","1929 Bentley 4-and-a-half-litre","1929-Bentley-4-and-a-half-litre_thumb.jpg",130,64,32);thumbnails[3438324]=new thumbnail(3438324,"174951","Loch Lomond on February 2nd","Loch Lomond 2 cp_thumb.jpg",130,63,32);thumbnails[2796013]=new thumbnail(2796013,"174951","Unknown Beach In Northwest Scotland","Mellon-Udrigle-Beach-2_thumb.jpg",130,71,32);thumbnails[3438314]=new thumbnail(3438314,"174951","Sunset on Cademuir Hill","Cademuir Sunset for web_thumb.jpg",130,60,32);thumbnails[2796019]=new thumbnail(2796019,"174951","Looking into Coigach from A835 Road near Ullapool","Looking-into-Coigach-from-A835-road_thumb.jpg",130,86,32);thumbnails[2796024]=new thumbnail(2796024,"174951","A Stormy Evening from Gairloch Beach","A-Stormy-Evening-From-Gairloch-Beach_thumb.jpg",130,56,32);thumbnails[2796029]=new thumbnail(2796029,"174951","Sunset from Achmelvich Youth Hostel","Sunset-Orange-2_thumb.jpg",130,81,32);thumbnails[2801762]=new thumbnail(2801762,"174951","Summit of Glamaig Looking North","Glamaig Panorama_thumb.jpg",130,49,32);var galleries=new Object();galleries[343467]=new gallery(343467,"3180306,2317820","Weddings 2","section410363",[6337465,3180306,3958074,6337589,6337605,2317820,2317792,2405575]);galleries[151453]=new gallery(151453,"5135100","Weddings","gallery",[3958080,3958088,5135244,2393157,2405571,2317803,2393143,2393132,2317796,2405630,2405637,2405639,5135013,5135076,5135087,2393153,5135100,5135110,5135255,5135259]);galleries[151606]=new gallery(151606,"2417505,2393206,2393198,2393197,2393195,2393190,2393187,2393183","Flowers","gallery",[2393187,2393190,2393197,2393198,2393206,2393183,2393195,2417505]);galleries[155292]=new gallery(155292,"3848239,2662991,2394024,2394022,2394019","Cycling","gallery",[2662991,2394019,2394022,2394024,3848239]);galleries[151452]=new gallery(151452,"2417484,2417454,2393556,2393552,2317817,2317812","Landscapes of Skye","gallery",[2317812,2317817,2393552,2393556,2417454,2417484]);galleries[151604]=new gallery(151604,"3438398,3180286,2321562,2321559","Mountains in Winter","gallery",[3438398,2321559,2321562,3180286]);galleries[155859]=new gallery(155859,"4013792,3958041,3958039,3958036,3958035,3438383,2661961,2405972,2405971,2405966","Sport","gallery",[2661961,3958035,3958036,3958039,3958041,4013792,2405911,2405913,2405966,2405971,2405972,3438383]);galleries[155866]=new gallery(155866,"2406038","Learning Photography","gallery",[3438349,3565904,4013808,2406038,2406266,2406269]);galleries[165440]=new gallery(165440,"2602294","Bo'Ness Revival Hillclimb (Motorsport)","gallery",[2602294,2602299,2602302,2602348]);galleries[174951]=new gallery(174951,"2796013","Beaches & Mountains","gallery",[3438324,2796013,3438314,2796019,2796024,2796029,2801762]);var imageSets=new Object();imageSets[1]="6337605,6337465,3958036,3438398,3438314,3180306,3180286,2801762,2796013,2661961,2602294,2406025,2405575,2394019,2393183,2317820,2317792";imageSets[2]="5135100,3438398,3180306,3180286,2796013,2602294,2406038,2406025,2321562,2321559,2317820";imageSets[3]="2317792";imageSets[236136]="6337605,6337589,6337465,5135255,5135244,5135110,5135100,5135076,5135013,3958088,3958080,3958074,3180306,2405575,2405571,2393157,2393143,2393132,2317820,2317803,2317796,2317792";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/Photobymarkdavey/images";break}switch(a){case 1:b="http://www1.clikpic.com/Photobymarkdavey/images";break}switch(a){case 2:b="http://admin.clikpic.com/Photobymarkdavey/images";break}switch(a){case 24:b="http://tpc15/clikpic/Photobymarkdavey/images";break}switch(a){case 4:b="http://www.clikchurch.com/Photobymarkdavey/images";break}switch(a){case 5:b="http://www2.clikpic.com/Photobymarkdavey/images";break}switch(a){case 22:b="http://tpc5/clikpic/Photobymarkdavey/images";break}switch(a){case 23:b="http://tpc10/clikpic/Photobymarkdavey/images";break}switch(a){case 25:b="http://tpc16/clikpic/Photobymarkdavey/images";break}switch(a){case 15:b="http://www3.clikpic.com/Photobymarkdavey/images";break}switch(a){case 18:b="http://www4.clikpic.com/Photobymarkdavey/images";break}switch(a){case 19:b="http://www5.clikpic.com/Photobymarkdavey/images";break}switch(a){case 31:b="http://www7.clikpic.com/Photobymarkdavey/images";break}switch(a){case 32:b="http://admin2.clikpic.com/Photobymarkdavey/images";break}switch(a){case 33:b="http://www8.clikpic.com/Photobymarkdavey/images";break}switch(a){case 34:b="http://www9.clikpic.com/Photobymarkdavey/images";break}switch(a){case 35:b="http://admin3.clikpic.com/Photobymarkdavey/images";break}switch(a){case 37:b="http://admin4.clikpic.com/Photobymarkdavey/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="PhotobyMarkDavey: "+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+'")'})}}};