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[3316668]=new thumbnail(3316668,"192248","Cows wending their way through poppy fields at Birling Gap on the South Downs","cowspoppies copy_thumb.jpg",130,87,5);thumbnails[3316696]=new thumbnail(3316696,"192248","Bird migration at Pagham Harbour","Pagham Harbour copy_thumb.jpg",130,81,5);thumbnails[3316705]=new thumbnail(3316705,"192248","Wave crashes over Palace Pier","storm palace pier_thumb.jpg",130,92,5);thumbnails[3320258]=new thumbnail(3320258,"192248","Startled deer out of cover in Cowfold","leaping deer_thumb.jpg",130,85,5);thumbnails[3320276]=new thumbnail(3320276,"192248","Last  picture taken of the West Pier at night before it collapsed","westrpier at night copy_thumb.jpg",130,91,5);thumbnails[3320324]=new thumbnail(3320324,"192248","Autumn Beech trees on the North Downs","beech leaves_thumb.jpg",130,87,5);thumbnails[3320370]=new thumbnail(3320370,"192248","Newhaven storm","newhaven storm copy_thumb.jpg",130,84,5);thumbnails[3320460]=new thumbnail(3320460,"192248","Winter berries in West Grinstead woods","winter berries copy_thumb.jpg",130,87,5);thumbnails[3320611]=new thumbnail(3320611,"192248","Atlantic storm hits fishermans hut at Cape Cornwall","CORNWALL hut_thumb.jpg",130,93,5);thumbnails[3320654]=new thumbnail(3320654,"192248","Silvery waters with Belle Toute Lighthouse","BEACHYHEAD LIGHTHOUSE copy_thumb.jpg",130,83,5);thumbnails[3331187]=new thumbnail(3331187,"192248","Starlings silhouetted over West Pier at sunset","starlings1_thumb.jpg",130,87,5);thumbnails[3331636]=new thumbnail(3331636,"192248","Atlantic roller gathers momentum at Cape Cornwall","Atlatic roller_thumb.jpg",130,87,5);thumbnails[3331669]=new thumbnail(3331669,"192248","Coloured skies over Cowfold","coloured sky copy_thumb.jpg",130,86,5);thumbnails[3331703]=new thumbnail(3331703,"192248","Deer run wild in West Grinstead","deerfrontfield_thumb.jpg",130,90,5);thumbnails[3331883]=new thumbnail(3331883,"192248","Harbour steps at Bonne Nuit Bay, Jersey","jersey-steps_thumb.jpg",130,95,5);thumbnails[3331919]=new thumbnail(3331919,"192248","Crabpots at Bonne Nuit Bay, Jersey","jersey-crabpots_thumb.jpg",130,94,5);thumbnails[3332204]=new thumbnail(3332204,"192248","Narrowboats at Loxwood on the Wey-Arun Canal, West Sussex","weyarun narrowboats_thumb.jpg",130,88,5);thumbnails[3332247]=new thumbnail(3332247,"192248","Golden sunset at low tide, Worthing","WORTHING copy1_thumb.jpg",130,87,5);thumbnails[3332269]=new thumbnail(3332269,"192248","Snow swept Weeping Silver Birch in spring, West Grinstead","WEEPSILVERBIRCH copy_thumb.jpg",130,87,5);thumbnails[3335435]=new thumbnail(3335435,"192248","High and Dry St Mary's Bay, Romney Marsh","highanddry copy_thumb.jpg",130,84,5);thumbnails[3336305]=new thumbnail(3336305,"192248","A crisp early winters morning on the River Adur","FROST copy5_thumb.jpg",130,191,5);thumbnails[3336355]=new thumbnail(3336355,"192248","Reflections on the Wey-Arun Canal","reflections copy_thumb.jpg",130,185,5);thumbnails[3336470]=new thumbnail(3336470,"192248","Sunrise reflects across a calm Cornish sea off St. Ives","sunrise copy_thumb.jpg",130,201,5);thumbnails[3336132]=new thumbnail(3336132,"192248","Boat chains in Bonne Nuit Harbour, Jersey","jersey-chains_thumb.jpg",130,173,5);thumbnails[3340195]=new thumbnail(3340195,"192248","Beech trees in autumn on the North Downs ","north downs-3 copy5_thumb.jpg",130,195,5);thumbnails[5493534]=new thumbnail(5493534,"192248","Queen's swans touch down on the River Thames at Windsor Castle","WINDSORSWANS2a_edited-1_thumb.jpg",130,88,5);thumbnails[3335646]=new thumbnail(3335646,"192248","A Silverbirch wood at Pulborough West Sussex","silverbirch wood_thumb.jpg",130,87,5);thumbnails[3335769]=new thumbnail(3335769,"192248","Coming Home, Newhaven Harbour","fishboatnewhaven copy_thumb.jpg",130,83,5);thumbnails[3335924]=new thumbnail(3335924,"192248","Winter Trees, West Sussex","winter trees copy_thumb.jpg",130,87,5);thumbnails[3339888]=new thumbnail(3339888,"192248","Train speeds across the Balcombe Viaduct","viaduct-train copy_thumb.jpg",130,83,5);thumbnails[3339921]=new thumbnail(3339921,"192248","First light the morning after the collapse of West Pier Brighton","broken pier copy_thumb.jpg",130,79,5);thumbnails[3339964]=new thumbnail(3339964,"192248","Bluebell wood in Cowfold","BLUEBELLS copy1_thumb.jpg",130,87,5);thumbnails[3343886]=new thumbnail(3343886,"192248","Sun rise over a misty Chichester Harbour","sunrisechichester copy2_thumb.jpg",130,96,5);thumbnails[3343906]=new thumbnail(3343906,"192248","Ducks march across the ice at Slaugham Ponds","ducks_thumb.jpg",130,79,5);thumbnails[3344040]=new thumbnail(3344040,"192248","Braving the tempest in Brighton","stormbeach copy_thumb.jpg",130,86,5);thumbnails[3344073]=new thumbnail(3344073,"192248","Aground at Dungeness","two boats copy_thumb.jpg",130,82,5);thumbnails[3965009]=new thumbnail(3965009,"192248","Captivating tree in Lamorna woods","ARTISTIC_TREE_CORNWALL_thumb.jpg",130,135,5);thumbnails[3964974]=new thumbnail(3964974,"192248","Cliffs at Lamorna Cove","WILDFLOWERS_LAMORNA_thumb.jpg",130,90,5);thumbnails[5358703]=new thumbnail(5358703,"192248","Robin in snow flight, West Grinstead, West Sussex","Robin_in_flight_copy_copy_thumb.jpg",130,202,5);thumbnails[5358706]=new thumbnail(5358706,"192248","Robin landing, West Grinstead","Robin_on_lampost_copy_copy_thumb.jpg",130,89,5);thumbnails[5358732]=new thumbnail(5358732,"192248","Christmas card robin, West Grinstead","christmas_card_robin_thumb.jpg",130,94,5);thumbnails[5484877]=new thumbnail(5484877,"192248","New Forest ponies in the mist","pony1_edited-2_copy_thumb.jpg",130,90,5);thumbnails[3320540]=new thumbnail(3320540,"192249","High summer sunset over West Pier","sunset over pier1_thumb.jpg",130,101,5);thumbnails[3320507]=new thumbnail(3320507,"192249","Retreating tide over rocks at Cape Cornwall","CORNWALLcaperocks_thumb.jpg",130,85,5);thumbnails[3336576]=new thumbnail(3336576,"192249","Sunrise reflects on a calm Cornish sea off St. Ives","sunrise-2 copy_thumb.jpg",130,194,5);thumbnails[3331745]=new thumbnail(3331745,"192249","Autumn wild seeds along the Wey-Arun Canal","Autumn-seeds_thumb.jpg",130,89,5);thumbnails[3332396]=new thumbnail(3332396,"192249","Raindrops in Maplehurst wood","rain drops copy_thumb.jpg",130,87,5);thumbnails[3331382]=new thumbnail(3331382,"192249","Arundel Castle in the snow","SNOWARUNDELCASTLE copy_thumb.jpg",130,84,5);thumbnails[3320734]=new thumbnail(3320734,"192249","Yacht returns to Bosham at dusk","bosham-1 copy_thumb.jpg",130,87,5);thumbnails[3392492]=new thumbnail(3392492,"192249","Victorian arches at Brighton East Sussex ","arches_thumb.jpg",130,87,5);thumbnails[3339837]=new thumbnail(3339837,"192249","Mayfly","mayfly3 copy_thumb.jpg",130,56,5);thumbnails[3344061]=new thumbnail(3344061,"192249","A room with a view at Cookmere Haven flanked by the Seven Sisters","cottages sevensisters_thumb.jpg",130,87,5);thumbnails[3343958]=new thumbnail(3343958,"192249","New Forest pony","newforest pony copy_thumb.jpg",130,90,5);thumbnails[3965013]=new thumbnail(3965013,"192249","Woodland ponds at Lamorna Cove","FERN_STREAM_CORNWALL-2_thumb.jpg",130,86,5);thumbnails[3340174]=new thumbnail(3340174,"192249","The blackened fishermans' huts stand tall on Hastings beach","fishnet huts-2 copy_thumb.jpg",130,188,5);thumbnails[3340187]=new thumbnail(3340187,"192249","The blackened fishermans' huts stand proud against the cliffs at Hastings beach","fishnet huts copy_thumb.jpg",130,87,5);thumbnails[3335967]=new thumbnail(3335967,"192249","Beachy Head Lighthouse","beachy head-4 copy_thumb.jpg",130,86,5);thumbnails[3336036]=new thumbnail(3336036,"192249","Waterfall at Lamorna Cove, Cornwall","CORNWALL-waterfall_thumb.jpg",130,87,5);thumbnails[3965011]=new thumbnail(3965011,"192249","Woodland waterfall at Lamorna Cove","FERN_STREAM_CORNWALL_thumb.jpg",130,181,5);thumbnails[3336072]=new thumbnail(3336072,"192249","Taking flight in Pagham Harbour","pagham taking flight_thumb.jpg",130,76,5);thumbnails[3335861]=new thumbnail(3335861,"192249","Arundel Castle","Arun-castle wideangle_thumb.jpg",130,86,5);thumbnails[3335687]=new thumbnail(3335687,"192249","Shipley Mill 'Home of Jonathon Creek'","SHIPLEY MILL copy_thumb.jpg",130,87,5);thumbnails[3335733]=new thumbnail(3335733,"192249","Roots, Chantonbury Ring","roots copy_thumb.jpg",130,80,5);thumbnails[3335446]=new thumbnail(3335446,"192249","Beached at St. Mary's Bay, Romney Marsh","highanddry-3 copy_thumb.jpg",130,83,5);thumbnails[3335542]=new thumbnail(3335542,"192249","Wey-Arun Canal at Loxwood","WEY-ARUN-trees_thumb.jpg",130,87,5);thumbnails[3335581]=new thumbnail(3335581,"192249","Hungry swan on the River Thames at Windsor","SWAN-BREAD copy_thumb.jpg",130,92,5);thumbnails[3331942]=new thumbnail(3331942,"192249","Moorhen raises her chicks in the middle of the River Thames near Windsor","MOORHEN copy_thumb.jpg",130,92,5);thumbnails[3332045]=new thumbnail(3332045,"192249","More winter berries in West Grinstead woods","winter berries-2_thumb.jpg",130,86,5);thumbnails[3331254]=new thumbnail(3331254,"192249","Arundel Castle stands proudly over the River Arun","arun-castlearun_thumb.jpg",130,86,5);thumbnails[3331428]=new thumbnail(3331428,"192249","The Royal Naval College overlooking the River Dart at Dartmouth","Dartmouth copy_thumb.jpg",130,87,5);thumbnails[3331553]=new thumbnail(3331553,"192249","The Dart Valley Railway steam train chugs gently along the River Dart","Dartmouth-train_thumb.jpg",130,88,5);thumbnails[3320713]=new thumbnail(3320713,"192249","Golden fields at Bosham","bosham-fields_thumb.jpg",130,87,5);thumbnails[3335490]=new thumbnail(3335490,"192249","High and Dry St. Mary's Bay, Romney Marsh","highanddry-2 copy_thumb.jpg",130,87,5);thumbnails[3964965]=new thumbnail(3964965,"192249","Fungi study","FUNGI_thumb.jpg",130,75,5);thumbnails[3428775]=new thumbnail(3428775,"192249","Light on moss, Goodwood","moss copy_thumb.jpg",130,83,5);thumbnails[5358704]=new thumbnail(5358704,"192249","Snow woods at Sedgewick West Sussex","snow_forest_wood_thumb.jpg",130,86,5);thumbnails[5358748]=new thumbnail(5358748,"192249","Piglet on ice, Monks Gate West Sussex","Pig_on_ice_copy_edited-1_thumb.jpg",130,87,5);thumbnails[3964956]=new thumbnail(3964956,"192249","Riding hard Cobo Beach Guernsey","horse_guernsey_thumb.jpg",130,89,5);var galleries=new Object();galleries[192248]=new gallery(192248,"3316668","Gallery 1","gallery",[3316668,3316696,3316705,3320258,3320276,3320324,3320370,3320460,3320611,3320654,3331187,3331636,3331669,3331703,3331883,3331919,3332204,3332247,3332269,3335435,3336305,3336355,3336470,3336132,3340195,5493534,3335646,3335769,3335924,3339888,3339921,3339964,3343886,3343906,3344040,3344073,3965009,3964974,5358703,5358706,5358732,5484877]);galleries[192249]=new gallery(192249,"3320540","Gallery 2","gallery",[3320540,3320507,3336576,3331745,3332396,3331382,3320734,3392492,3339837,3344061,3343958,3965013,3340174,3340187,3335967,3336036,3965011,3336072,3335861,3335687,3335733,3335446,3335542,3335581,3331942,3332045,3331254,3331428,3331553,3320713,3335490,3964965,3428775,5358704,5358748,3964956]);var imageSets=new Object();imageSets[1]="3316668";imageSets[2]="3320540,3316668";imageSets[3]="5493534,5484877,5358748,5358732,5358706,5358704,5358703,3965013,3965011,3965009,3964974,3964965,3964956,3428775,3392492,3344073,3344061,3344040,3343958,3343906,3343886,3340195,3340187,3340174,3339964,3339921,3339888,3339837,3336576,3336470,3336355,3336305,3336132,3336072,3336036,3335967,3335924,3335861,3335769,3335733,3335687,3335646,3335581,3335542,3335490,3335446,3335435,3332396,3332269,3332247";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/gerrypenny/images";break}switch(a){case 1:b="http://www1.clikpic.com/gerrypenny/images";break}switch(a){case 2:b="http://admin.clikpic.com/gerrypenny/images";break}switch(a){case 24:b="http://tpc15/clikpic/gerrypenny/images";break}switch(a){case 4:b="http://www.clikchurch.com/gerrypenny/images";break}switch(a){case 5:b="http://www2.clikpic.com/gerrypenny/images";break}switch(a){case 22:b="http://tpc5/clikpic/gerrypenny/images";break}switch(a){case 23:b="http://tpc10/clikpic/gerrypenny/images";break}switch(a){case 25:b="http://tpc16/clikpic/gerrypenny/images";break}switch(a){case 15:b="http://www3.clikpic.com/gerrypenny/images";break}switch(a){case 18:b="http://www4.clikpic.com/gerrypenny/images";break}switch(a){case 19:b="http://www5.clikpic.com/gerrypenny/images";break}switch(a){case 31:b="http://www7.clikpic.com/gerrypenny/images";break}switch(a){case 32:b="http://admin2.clikpic.com/gerrypenny/images";break}switch(a){case 33:b="http://www8.clikpic.com/gerrypenny/images";break}switch(a){case 34:b="http://www9.clikpic.com/gerrypenny/images";break}switch(a){case 35:b="http://admin3.clikpic.com/gerrypenny/images";break}switch(a){case 37:b="http://admin4.clikpic.com/gerrypenny/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="southcoastgallery: "+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>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="GERRYPENNY">';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+'")'})}}};