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[5305877]=new thumbnail(5305877,"","","P1080180_152543_thumb.jpg",130,83,18);thumbnails[5319120]=new thumbnail(5319120,"","","P1080345_thumb.JPG",130,86,18);thumbnails[4695797]=new thumbnail(4695797,"","","P1060347_thumb.JPG",130,83,18);thumbnails[5276078]=new thumbnail(5276078,"257828","Zennor Church<br>\r\nWest Cornwall.","P1040213_thumb.JPG",130,84,18);thumbnails[4648589]=new thumbnail(4648589,"257828","Polperro Harbour","P1060342_116530_thumb.jpg",130,84,18);thumbnails[4557981]=new thumbnail(4557981,"257828","Zennor Village, Cornwall","P1060316_thumb.JPG",130,96,18);thumbnails[4477203]=new thumbnail(4477203,"257828","Awaiting The Tide<br>\r\nPolperro Harbour","img150_thumb.jpg",130,95,18);thumbnails[4400466]=new thumbnail(4400466,"257828","Passing Light, St.Ives","P1000326_thumb.JPG",130,90,18);thumbnails[6091202]=new thumbnail(6091202,"257828","Zennor Village<br>\r\nWest Cornwall","P1040018_thumb.JPG",130,96,18);thumbnails[4396996]=new thumbnail(4396996,"257828","Passing Light, Penberth Cove","P1050327_thumb.jpg",130,85,18);thumbnails[4396492]=new thumbnail(4396492,"257828","A Fine Morning, St.Ives Harbour","P1050325_thumb.jpg",130,84,18);thumbnails[4477180]=new thumbnail(4477180,"257828","Polperro Harbour","img145_thumb.jpg",130,83,18);thumbnails[4396995]=new thumbnail(4396995,"257828","St.Ives Harbour","P1050322_thumb.jpg",130,96,18);thumbnails[4400363]=new thumbnail(4400363,"257828","Mousehole Harbour","P1060094_thumb.JPG",130,93,18);thumbnails[4400369]=new thumbnail(4400369,"257828","Priests Cove, Cape Cornwall","P1050197_thumb.jpg",130,79,18);thumbnails[4400367]=new thumbnail(4400367,"257828","Polperro Fishing Boats","P1060105_thumb.JPG",130,83,18);thumbnails[4400366]=new thumbnail(4400366,"257828","St.Ives Fishing Boats","P1060103_thumb.JPG",130,93,18);thumbnails[4400365]=new thumbnail(4400365,"257828","Boats At Mounts Bay, Cornwall","P1060101_thumb.JPG",130,91,18);thumbnails[4400355]=new thumbnail(4400355,"257828","Low Tide At Polperro","P1060089_thumb.JPG",130,87,18);thumbnails[4400360]=new thumbnail(4400360,"257828","The Pandora Inn, Cornwall","P1060091_thumb.JPG",130,84,18);thumbnails[4400371]=new thumbnail(4400371,"257828","Wheal Coates Mine, Cornwall","P1060135_thumb.JPG",130,85,18);thumbnails[4400372]=new thumbnail(4400372,"257828","Wheal Friendly Mine, St.Agnes","P1060137_thumb.JPG",130,85,18);thumbnails[4396999]=new thumbnail(4396999,"257828","Wheal Trewavas Mines, Cornwall","P1050455_thumb.JPG",130,90,18);thumbnails[4396429]=new thumbnail(4396429,"257823","Haybales And Beacons II","P1050459_thumb.JPG",130,90,18);thumbnails[4397035]=new thumbnail(4397035,"257823",'"Summers Afternoon, Brecon Beacons"',"P1020312_thumb.JPG",130,80,18);thumbnails[4397040]=new thumbnail(4397040,"257823",'"Snow On The Beacons"',"P1020484_thumb.JPG",130,78,18);thumbnails[4397041]=new thumbnail(4397041,"257823",'"Haybales And Beacons"',"P1050335_thumb.JPG",130,89,18);thumbnails[4397042]=new thumbnail(4397042,"257823",'"Brecon Beacons Farmhouse"',"P1050451_thumb.JPG",130,93,18);thumbnails[4397044]=new thumbnail(4397044,"257823",'"Summer Meadow, Brecon Beacons"',"P1050492_thumb.JPG",130,81,18);thumbnails[4397045]=new thumbnail(4397045,"257823",'"Passing Light, Brecon Beacons"',"P1050544_thumb.JPG",130,80,18);thumbnails[4397075]=new thumbnail(4397075,"257823",'"Pen Y Fan From Mynydd Illtyd"',"img076_thumb.jpg",130,84,18);thumbnails[4397076]=new thumbnail(4397076,"257823",'"Brecon Beacons From Mynnid Illtyd"',"img077_thumb.jpg",130,79,18);thumbnails[4397077]=new thumbnail(4397077,"257823",'"Brecon Beacons From Llanfrynach"',"img078_thumb.jpg",130,82,18);thumbnails[4397078]=new thumbnail(4397078,"257823",'"Brecon Beacons From The Upper Neuadd"',"img079_thumb.jpg",130,78,18);thumbnails[4397079]=new thumbnail(4397079,"257823",'"Sunlight Over The Beacons"',"img071_thumb.jpg",130,80,18);thumbnails[4406118]=new thumbnail(4406118,"257823",'"Snow On The Peaks", Brecon Beacons',"P1060143_thumb.JPG",130,89,18);thumbnails[4454028]=new thumbnail(4454028,"257823","Pen-Y-Fan<br>\r\nFrom Upper Neuadd Reservoir","P1060164_thumb.JPG",130,89,18);thumbnails[4481356]=new thumbnail(4481356,"257823",'"Moorland Stream", Brecon Beacons',"img154_thumb.jpg",130,74,18);thumbnails[4492547]=new thumbnail(4492547,"257823",'"View From The Beacons"',"P1060278_thumb.JPG",130,88,18);thumbnails[4492548]=new thumbnail(4492548,"257823","","P1060286_thumb.JPG",130,68,18);thumbnails[4396515]=new thumbnail(4396515,"257824",'"Porthgain Harbour"<br>\r\nNorth Pembrokeshire',"img128_thumb.jpg",130,88,18);thumbnails[4396558]=new thumbnail(4396558,"257824",'"Waiting For The Tide, Fishguard Harbour"',"img081_thumb.jpg",130,89,18);thumbnails[4397066]=new thumbnail(4397066,"257824",'"Fishing Boats At Solva"',"img072_thumb.jpg",130,68,18);thumbnails[4397067]=new thumbnail(4397067,"257824",'"Abereiddy Cottages"',"img075_thumb.jpg",130,74,18);thumbnails[4397069]=new thumbnail(4397069,"257824",'"Road To Carn Llidi"<br>\r\nNorth Pembrokeshire',"img073_thumb.jpg",130,81,18);thumbnails[4397071]=new thumbnail(4397071,"257824",'"Preseli Cottage"<br>\r\nNorth Pembrokeshire',"img1221_thumb.jpg",130,89,18);thumbnails[4397072]=new thumbnail(4397072,"257824",'"High And Dry, Fishguard Harbour"',"P1050340_thumb.JPG",130,88,18);thumbnails[4397074]=new thumbnail(4397074,"257824",'"Fishguard Harbour"',"P1050333_thumb.JPG",130,88,18);thumbnails[4398379]=new thumbnail(4398379,"257824",'"Low Tide At Solva Harbour"',"P1020110_thumb.JPG",130,41,18);thumbnails[4402013]=new thumbnail(4402013,"257824",'"Trehowell Farm"<br>\r\nNorth Pembrokeshire',"P10501892_thumb.JPG",130,79,18);thumbnails[4402034]=new thumbnail(4402034,"257824",'"Pembrokeshire Cottage"',"P1060085_thumb.JPG",130,94,18);thumbnails[4402038]=new thumbnail(4402038,"257824",'"Road To Carn Llidi"<br>\r\nNorth Pembrokeshire',"P1060095_thumb.JPG",130,80,18);thumbnails[4402044]=new thumbnail(4402044,"257824",'"Farm Near St.Davids"<br>\r\nNorth Pembrokeshire',"P1060098_thumb.JPG",130,94,18);thumbnails[4402048]=new thumbnail(4402048,"257824",'"Llanferran Farm"<br>\r\nNorth Pembrokeshire',"P1060099_thumb.JPG",130,81,18);thumbnails[4402051]=new thumbnail(4402051,"257824",'"Carew Castle"<br>\r\nSouth Pembrokeshire',"P10601071_thumb.JPG",130,41,18);thumbnails[4402060]=new thumbnail(4402060,"257824",'"Carew Castle"<br>\r\nSouth Pembrokeshire',"P1060110_thumb.JPG",130,97,18);thumbnails[4402063]=new thumbnail(4402063,"257824",'"Strumble Lighthouse"<br>\r\nNorth Pembrokeshire',"P1060114_thumb.JPG",130,78,18);thumbnails[4402066]=new thumbnail(4402066,"257824",'"Coastal Cottage, Porthclais"<br>\r\n',"P1060116_thumb.JPG",130,86,18);thumbnails[4402071]=new thumbnail(4402071,"257824",'"Cottage At Porthclais"',"P1060119_thumb.JPG",130,73,18);thumbnails[4402075]=new thumbnail(4402075,"257824",'"Pembrokeshire Thatched Cottage"',"P1060121_thumb.JPG",130,90,18);thumbnails[4402078]=new thumbnail(4402078,"257824",'"The Watch Cottage, Llanrhian"<br>\r\nNorth Pembrokeshire',"P1060123_thumb.JPG",130,69,18);thumbnails[4402093]=new thumbnail(4402093,"257824",'"Misty Morning At Solva Harbour"',"P1020645_thumb.JPG",130,88,18);thumbnails[4402098]=new thumbnail(4402098,"257824",'"Boats At Porthclais Harbour"<br>\r\nNorth Pembrokeshire',"P1060139_thumb.JPG",130,82,18);thumbnails[4465006]=new thumbnail(4465006,"257824",'"Pembrokeshire Farm"',"P1050482_thumb.JPG",130,78,18);thumbnails[5046043]=new thumbnail(5046043,"257824",'"Cottage at Garn Fawr"<br>\r\nNorth Pembrokeshire<br>\r\n',"P1070758_thumb.JPG",130,79,18);thumbnails[5305788]=new thumbnail(5305788,"257824",'"Evening at Solva Harbour"',"img156_thumb.jpg",130,127,18);thumbnails[5305855]=new thumbnail(5305855,"257824",'"Cottages at Aberfelin"<br>\r\nNorth Pembrokeshire<br>\r\n<br>\r\n',"CNV00011_thumb.jpg",130,92,18);thumbnails[5354915]=new thumbnail(5354915,"257824",'"Misty Morning, Angle"',"P1080538_thumb.JPG",130,184,18);thumbnails[4673723]=new thumbnail(4673723,"257824",'"Abercastle"<br>\r\nNorth Pembrokeshire',"P1060383_thumb.JPG",130,88,18);thumbnails[4396517]=new thumbnail(4396517,"257832",'"Herefordshire Cottage, Hampton Bishop"',"P1050329_thumb.JPG",130,80,18);thumbnails[4396878]=new thumbnail(4396878,"257832",'"Herefordshire Farmhouse"',"P1030801_thumb.JPG",130,84,18);thumbnails[4396904]=new thumbnail(4396904,"257832",'"Herefordshire Farmhouse"',"P1050188_thumb.JPG",130,76,18);thumbnails[4396905]=new thumbnail(4396905,"257832",'"Farmhouse Near Eardisland"',"P1050446_thumb.JPG",130,93,18);thumbnails[4402157]=new thumbnail(4402157,"257832",'"Derelict Barn, Herefordshire"',"P1050725_thumb.JPG",130,82,18);thumbnails[4402130]=new thumbnail(4402130,"258059",'"Cotswold Cottage"',"P1020221_thumb.JPG",130,94,18);thumbnails[4655852]=new thumbnail(4655852,"268444",'"Appledore"<br>\r\nNorth Devon',"img107_thumb.jpg",130,86,18);thumbnails[4775286]=new thumbnail(4775286,"268444",'"Dartmoor Farmhouse"',"P1060141_thumb.JPG",130,81,18);thumbnails[6543969]=new thumbnail(6543969,"268444","Passing Light<br>\r\nDartmoor","P1040980_thumb.JPG",130,98,18);thumbnails[4958543]=new thumbnail(4958543,"268444",'"Moorland Farm"<br>\r\n Dartmoor',"P1070672_thumb.jpg",130,82,18);var galleries=new Object();galleries[257828]=new gallery(257828,"6091202,5276078,4648589","Cornwall Paintings","gallery",[5276078,4648589,4557981,4477203,4400466,6091202,4396996,4396492,4477180,4396995,4400363,4400369,4400367,4400366,4400365,4400355,4400360,4400371,4400372,4396999]);galleries[257823]=new gallery(257823,"4396429","Brecon Beacons Paintings","gallery",[4396429,4397035,4397040,4397041,4397042,4397044,4397045,4397075,4397076,4397077,4397078,4397079,4406118,4454028,4481356,4492547,4492548]);galleries[257824]=new gallery(257824,"5305788,4673723,4396558","Pembrokeshire Paintings","gallery",[4396515,4396558,4397066,4397067,4397069,4397071,4397072,4397074,4398379,4402013,4402034,4402038,4402044,4402048,4402051,4402060,4402063,4402066,4402071,4402075,4402078,4402093,4402098,4465006,5046043,5305788,5305855,5354915,4673723]);galleries[257832]=new gallery(257832,"4396517","Herefordshire Paintings","gallery",[4396517,4396878,4396904,4396905,4402157]);galleries[258059]=new gallery(258059,"4402130","Cotswold Paintings","gallery",[4402130]);galleries[268444]=new gallery(268444,"6543969,4655852","Devon Paintings","gallery",[4655852,4775286,6543969,4958543]);var imageSets=new Object();imageSets[1]="6543969,6091202,5276078,4648589,4557981,4400466,4396996,4396492,4396429";imageSets[2]="6543969,6091202,5305788,5276078,4673723,4655852,4648589,4396558,4396517,4396429";imageSets[3]="6543969,6091202,5354915,5319120,5305877,5305855,5305788,5276078,5046043,4958543,4775286,4695797,4673723,4655852,4648589,4557981,4492548,4492547,4481356,4477203,4477180,4465006,4454028,4406118,4402157,4402130,4402098,4402093,4402078,4402075,4402071,4402066,4402063,4402060,4402051,4402048,4402044,4402038,4402034,4402013,4400466,4400372,4400371,4400369,4400367,4400366,4400365,4400363,4400360,4400355";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/maxwell/images";break}switch(a){case 1:b="http://www1.clikpic.com/maxwell/images";break}switch(a){case 2:b="http://admin.clikpic.com/maxwell/images";break}switch(a){case 24:b="http://tpc15/clikpic/maxwell/images";break}switch(a){case 4:b="http://www.clikchurch.com/maxwell/images";break}switch(a){case 5:b="http://www2.clikpic.com/maxwell/images";break}switch(a){case 22:b="http://tpc5/clikpic/maxwell/images";break}switch(a){case 23:b="http://tpc10/clikpic/maxwell/images";break}switch(a){case 25:b="http://tpc16/clikpic/maxwell/images";break}switch(a){case 15:b="http://www3.clikpic.com/maxwell/images";break}switch(a){case 18:b="http://www4.clikpic.com/maxwell/images";break}switch(a){case 19:b="http://www5.clikpic.com/maxwell/images";break}switch(a){case 31:b="http://www7.clikpic.com/maxwell/images";break}switch(a){case 32:b="http://admin2.clikpic.com/maxwell/images";break}switch(a){case 33:b="http://www8.clikpic.com/maxwell/images";break}switch(a){case 34:b="http://www9.clikpic.com/maxwell/images";break}switch(a){case 35:b="http://admin3.clikpic.com/maxwell/images";break}switch(a){case 37:b="http://admin4.clikpic.com/maxwell/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="Mark Whittaker Fine Art Pastels: "+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="mark.whittaker11@ntlworld.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="mark.whittaker11@ntlworld.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 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+'")'})}}};