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[5302599]=new thumbnail(5302599,"254326","Santa Fun Run.","AH51410n_thumb.jpg",130,87,18);thumbnails[4601097]=new thumbnail(4601097,"254326","Rye Raft Race.","rye-raft-race-09-228_thumb.jpg",130,87,18);thumbnails[4497370]=new thumbnail(4497370,"","Amy in the sea.","_PSK1019-3_thumb.jpg",130,130,18);thumbnails[4448967]=new thumbnail(4448967,"254326","Fun Day at Bodiam Castle.","AH33700c_thumb.jpg",130,86,18);thumbnails[4444070]=new thumbnail(4444070,"254326","Crown Lane Bike Race.","old-town-bike-race-03-2_thumb.jpg",130,86,18);thumbnails[4444306]=new thumbnail(4444306,"254326","Crown Lane Bike Race.","old-town-bike-race-19_thumb.jpg",130,86,18);thumbnails[4437302]=new thumbnail(4437302,"254326","Arabella Martin.","AH32711j_thumb.jpg",130,86,18);thumbnails[4431079]=new thumbnail(4431079,"254326","Town Criers Competition.","AH32709h_thumb.jpg",130,87,18);thumbnails[4431085]=new thumbnail(4431085,"254326","Town Criers Competition.","_PSK8712_thumb.jpg",130,87,18);thumbnails[4431089]=new thumbnail(4431089,"254326","A dog in a window in Hastings Old Town.","_PSK8664_thumb.jpg",130,87,18);thumbnails[4424031]=new thumbnail(4424031,"254326","Julie Naylor & Roger Verity.","_PSK0155_thumb.jpg",130,86,18);thumbnails[4424247]=new thumbnail(4424247,"254326","Roger Verity.","_PSK0225_thumb.jpg",130,86,18);thumbnails[4424255]=new thumbnail(4424255,"254326","Tools being sold following barn fire.","_PSK0199_thumb.jpg",130,86,18);thumbnails[4424906]=new thumbnail(4424906,"254326","Dyamond Dance at The Polegrove.","dyamond-dance-05_thumb.jpg",130,87,18);thumbnails[4316684]=new thumbnail(4316684,"254326","Flooding in St. Leonards.","Flooding-21_thumb.jpg",130,86,18);thumbnails[4316697]=new thumbnail(4316697,"254326","Flooding in Hastings.","Flooding-37_thumb.jpg",130,86,18);thumbnails[4316708]=new thumbnail(4316708,"254326","Flooding in St. Leonards.","Flooding-03_thumb.jpg",130,86,18);thumbnails[4316712]=new thumbnail(4316712,"254326","Flooding in St. Leonards.","Flooding-14_thumb.jpg",130,86,18);thumbnails[4316617]=new thumbnail(4316617,"254326","Hastings Beer & Music Festival 2009.","AH28400hbmf-17_thumb.jpg",130,86,18);thumbnails[4316647]=new thumbnail(4316647,"254326","Hastings Beer & Music Festival 2009.","AH28400hbmf-271_thumb.jpg",130,86,18);thumbnails[4316659]=new thumbnail(4316659,"254326","Hastings Beer & Music Festival 2009.","AH28400hbmf-45_thumb.jpg",130,112,18);thumbnails[4317434]=new thumbnail(4317434,"254326","St. George's Day Parade.","AH18501i_thumb.jpg",130,87,18);thumbnails[4317440]=new thumbnail(4317440,"254326","St. George's Day Parade.","AH18500v_thumb.jpg",130,87,18);thumbnails[4317448]=new thumbnail(4317448,"254326","St. George's Day Parade.","AH18501w_thumb.jpg",130,87,18);thumbnails[585450]=new thumbnail(585450,"44507","Bodiam Castle","_PK20402_thumb.jpg",130,87,18);thumbnails[4645982]=new thumbnail(4645982,"254326","","H24999_1021_thumb.jpg",130,86,18);thumbnails[4438755]=new thumbnail(4438755,"254326","Anti-BNP protestors.","H18400u_thumb.jpg",130,94,18);thumbnails[4438753]=new thumbnail(4438753,"254326","Start of the Bexhill 100 Motoring Club parade.","H17406a_thumb.jpg",130,90,18);thumbnails[2179934]=new thumbnail(2179934,"45060","Three cows","_PSK2625_thumb.jpg",130,197,18);thumbnails[4438751]=new thumbnail(4438751,"254326","Charity event.","H15403b1_thumb.jpg",130,86,18);thumbnails[4438758]=new thumbnail(4438758,"254326","Fire Brigade Exercise.","PSK_8340_thumb.jpg",130,86,18);thumbnails[2995453]=new thumbnail(2995453,"254326","","PSK_7672-2_thumb.jpg",130,86,18);thumbnails[585448]=new thumbnail(585448,"45060","Red Toadstool","redfungi_thumb.jpg",130,87,18);thumbnails[585445]=new thumbnail(585445,"45060","Funfair","funfair_thumb.jpg",130,87,18);thumbnails[585446]=new thumbnail(585446,"45060","Steam Engine","steamwheel_thumb.jpg",130,87,18);thumbnails[576891]=new thumbnail(576891,"44474","The Grand Canal, Venice","P7151179_thumb.JPG",130,98,18);thumbnails[576893]=new thumbnail(576893,"44474","A Street Scene, Venice","P7151181_thumb.JPG",130,98,18);thumbnails[576894]=new thumbnail(576894,"44474","Backwater, Venice","P7151194_thumb.JPG",130,98,18);thumbnails[576896]=new thumbnail(576896,"44474","A Gondola, Venice","P7151198_thumb.JPG",130,98,18);thumbnails[577513]=new thumbnail(577513,"44507","Rushes","rushes_thumb.jpg",130,87,18);thumbnails[585449]=new thumbnail(585449,"44507","Sheffield Park","sheffieldparkswan_thumb.jpg",130,87,18);thumbnails[585447]=new thumbnail(585447,"44474","Blue Boat, Tunisia","blueboat_thumb.jpg",130,87,18);thumbnails[577501]=new thumbnail(577501,"44507","Polperro harbour","polperro_thumb.jpg",130,87,18);thumbnails[574786]=new thumbnail(574786,"44341","The Seven Sisters","277-7758_IMG_thumb.jpg",130,87,18);thumbnails[575023]=new thumbnail(575023,"","","about us_thumb.jpg",130,123,18);thumbnails[576878]=new thumbnail(576878,"44474","","P7080895_thumb.JPG",130,98,18);thumbnails[576881]=new thumbnail(576881,"44474","","P7101006_thumb.JPG",130,98,18);thumbnails[576882]=new thumbnail(576882,"44474","","P7101012_thumb.JPG",130,98,18);thumbnails[576886]=new thumbnail(576886,"44474","","P7111077_thumb.JPG",130,98,18);thumbnails[576887]=new thumbnail(576887,"44474","","P7121107_thumb.JPG",130,98,18);thumbnails[2436458]=new thumbnail(2436458,"254441","","_psk0000_thumb.jpg",130,86,18);thumbnails[4320244]=new thumbnail(4320244,"254441","","_PSK0240_thumb.jpg",130,86,18);thumbnails[4320247]=new thumbnail(4320247,"254441","","_PSK0331_thumb.jpg",130,86,18);thumbnails[4320248]=new thumbnail(4320248,"254441","","_PSK3102_thumb.jpg",130,86,18);thumbnails[4320255]=new thumbnail(4320255,"254441","","dhw017_thumb.jpg",130,76,18);thumbnails[4320263]=new thumbnail(4320263,"254441","","dhw139_thumb.jpg",130,87,18);thumbnails[4317401]=new thumbnail(4317401,"254326","Grace at 101 Years Old.","_PSK8473_thumb.jpg",130,86,18);thumbnails[4317359]=new thumbnail(4317359,"254326","Bexhill Horse Show.","bhs2009-005_thumb.jpg",130,87,18);thumbnails[4317418]=new thumbnail(4317418,"254326","St. George's Day Parade.","AH18500e_thumb.jpg",130,87,18);thumbnails[4317442]=new thumbnail(4317442,"254326","Chelsea Pensioners.","AH18502u_thumb.jpg",130,86,18);thumbnails[1147386]=new thumbnail(1147386,"","","Tracy COL 002_thumb.jpg",130,198,18);thumbnails[4317325]=new thumbnail(4317325,"254326","NSPCC Fashion Show.","_PSK7473_thumb.jpg",130,130,18);thumbnails[4316655]=new thumbnail(4316655,"254326","Hastings Beer & Music Festival 2009.","AH28400hbmf-18_thumb.jpg",130,196,18);thumbnails[4317375]=new thumbnail(4317375,"254326","Bexhill Horse Show.","bhs2009-0152_thumb.jpg",130,196,18);thumbnails[4317428]=new thumbnail(4317428,"254326","St. George's Day Parade.","AH18500o_thumb.jpg",130,194,18);thumbnails[4317467]=new thumbnail(4317467,"254326","A Google Street View Car in Hastings.","AH17401a_thumb.jpg",130,196,18);thumbnails[2322355]=new thumbnail(2322355,"","","td1forweb1_thumb.jpg",130,92,18);thumbnails[2065553]=new thumbnail(2065553,"43656","The fleet in the snow.","H15408f_thumb.jpg",130,86,18);thumbnails[4495481]=new thumbnail(4495481,"50810","Amy on the sea.","amy-beach-2_thumb.jpg",130,94,18);thumbnails[4528280]=new thumbnail(4528280,"50810","","amy-double-b2b-3_thumb.jpg",130,98,18);thumbnails[2985372]=new thumbnail(2985372,"50810","","PSK_8702_thumb.jpg",130,197,18);thumbnails[2985374]=new thumbnail(2985374,"50810","","PSK_8829_thumb.jpg",130,197,18);thumbnails[2322393]=new thumbnail(2322393,"50810","","td2forweb_thumb.jpg",130,207,18);thumbnails[4424491]=new thumbnail(4424491,"50810","","lwf22_thumb.jpg",130,86,18);thumbnails[1147357]=new thumbnail(1147357,"50810","","kb1forweb_thumb.jpg",130,193,18);thumbnails[2322028]=new thumbnail(2322028,"50810","","kb2forweb_thumb.jpg",130,188,18);thumbnails[3134776]=new thumbnail(3134776,"50810","","Bannatyne-Spa-Launch-Hastings-040-3_thumb.jpg",130,195,18);thumbnails[1147378]=new thumbnail(1147378,"50810","","IMG_2798_thumb.jpg",130,195,18);thumbnails[4317227]=new thumbnail(4317227,"50810","Zoe Griffin.","_PSK8946_thumb.jpg",130,86,18);thumbnails[1147366]=new thumbnail(1147366,"50810","","IMG_1268_thumb.jpg",130,87,18);thumbnails[4317291]=new thumbnail(4317291,"50810","","_PSK8834_thumb.jpg",130,130,18);thumbnails[1147380]=new thumbnail(1147380,"50810","","IMG_9075_thumb.jpg",130,87,18);thumbnails[1147381]=new thumbnail(1147381,"50810","","wbforweb_thumb.jpg",130,88,18);thumbnails[2198528]=new thumbnail(2198528,"50810","","PSK_0689_copy_thumb.jpg",130,86,18);thumbnails[2626454]=new thumbnail(2626454,"50810","","_PSK6706_thumb.jpg",130,86,18);thumbnails[3135011]=new thumbnail(3135011,"50810","","rv1_thumb.jpg",130,87,18);thumbnails[3135014]=new thumbnail(3135014,"50810","","rv2_thumb.jpg",130,87,18);var galleries=new Object();galleries[44474]=new gallery(44474,"585447","International","gallery",[576891,576893,576894,576896,585447,576878,576881,576882,576886,576887]);galleries[254326]=new gallery(254326,"5302599,4645982,4601097,4448967,4444306,4444070,4438758,4438755,4438753,4438751,4437302,4431089,4431085,4431079,4424906,4424255,4424247,4424031,4317448,4317442,4317440,4317434,4317418,4317401,4317359,4316712,4316708,4316697,4316684,4316647,4316617","Local Interest","gallery",[5302599,4601097,4448967,4444070,4444306,4437302,4431079,4431085,4431089,4424031,4424247,4424255,4424906,4316684,4316697,4316708,4316712,4316617,4316647,4316659,4317434,4317440,4317448,4645982,4438755,4438753,4438751,4438758,2995453,4317401,4317359,4317418,4317442,4317325,4316655,4317375,4317428,4317467]);galleries[45060]=new gallery(45060,"585448,585445","Out and About","gallery",[2179934,585448,585445,585446]);galleries[44507]=new gallery(44507,"585450,585449,577513,577501","Picturesque","gallery",[585450,577513,585449,577501]);galleries[137978]=new gallery(137978,"2065553,585450,585449,585448,585447,585445,577513,577501,574786","Places","gallery",[]);galleries[44341]=new gallery(44341,"574786","The South Downs","gallery",[574786]);galleries[254441]=new gallery(254441,"4320263,4320255,4320248,4320247,4320244","Weddings","gallery",[2436458,4320244,4320247,4320248,4320255,4320263]);galleries[43656]=new gallery(43656,"2065553","The Beach","gallery",[2065553]);galleries[50810]=new gallery(50810,"4528280,4495481,4424491,4317227,3135014,3135011,2985374,2985372,2626454,2322393,2198528,1147381,1147380,1147366","People","gallery",[4495481,4528280,2985372,2985374,2322393,4424491,1147357,2322028,3134776,1147378,4317227,1147366,4317291,1147380,1147381,2198528,2626454,3135011,3135014]);var imageSets=new Object();imageSets[1]="5302599,4645982,4601097,4528280,4448967,4444306,4444070,4438758,4438755,4438753,4438751,4437302,4431089,4431085,4431079,4424906,4424491,4424255,4424247,4424031,4320263,4320255,4320248,4320247,4320244,4317448,4317442,4317440,4317434,4317418,4317401,4317359,4317227,4316712,4316708,4316697,4316684,4316647,4316617,2995453,2626454,2436458,2198528,2065553,1147381,1147380,1147366,585450,585449,585447,577513,577501,574786";imageSets[2]="5302599,4645982,4601097,4528280,4495481,4448967,4444306,4444070,4438758,4438755,4438753,4438751,4437302,4431089,4431085,4431079,4424906,4424491,4424255,4424247,4424031,4320263,4320255,4320248,4320247,4320244,4317448,4317442,4317440,4317434,4317418,4317401,4317359,4317227,4316712,4316708,4316697,4316684,4316647,4316617,3135014,3135011,2985374,2985372,2626454,2322393,2198528,2065553,1147381,1147380,1147366,585450,585449,585448,585447,585445,577513,577501,574786";imageSets[3]="4316712,4316708,4316697,4316684,4316647,4316617";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/paulkelly/images";break}switch(a){case 1:b="http://www1.clikpic.com/paulkelly/images";break}switch(a){case 2:b="http://admin.clikpic.com/paulkelly/images";break}switch(a){case 24:b="http://tpc15/clikpic/paulkelly/images";break}switch(a){case 4:b="http://www.clikchurch.com/paulkelly/images";break}switch(a){case 5:b="http://www2.clikpic.com/paulkelly/images";break}switch(a){case 22:b="http://tpc5/clikpic/paulkelly/images";break}switch(a){case 23:b="http://tpc10/clikpic/paulkelly/images";break}switch(a){case 25:b="http://tpc16/clikpic/paulkelly/images";break}switch(a){case 15:b="http://www3.clikpic.com/paulkelly/images";break}switch(a){case 18:b="http://www4.clikpic.com/paulkelly/images";break}switch(a){case 19:b="http://www5.clikpic.com/paulkelly/images";break}switch(a){case 31:b="http://www7.clikpic.com/paulkelly/images";break}switch(a){case 32:b="http://admin2.clikpic.com/paulkelly/images";break}switch(a){case 33:b="http://www8.clikpic.com/paulkelly/images";break}switch(a){case 34:b="http://www9.clikpic.com/paulkelly/images";break}switch(a){case 35:b="http://admin3.clikpic.com/paulkelly/images";break}switch(a){case 37:b="http://admin4.clikpic.com/paulkelly/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="County Images: "+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="pskhastings-paypal@yahoo.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="pskhastings-paypal@yahoo.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 e=$("img#gallery"+c);e.parents(".thumbWrap").width(b.width);var a=e.siblings("h3").size()==1?e.siblings("h3"):e.parent(".thumbWrap").siblings("h3");var f=parseInt(a.css("padding-left"))+parseInt(a.css("padding-right"));var d=parseInt(a.css("border-left-width"))+parseInt(a.css("border-right-width"));a.width(e.outerWidth(true)-f-d)}}}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+'")'})}}};