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[2574219]=new thumbnail(2574219,"","","1 small 160_thumb.jpg",130,87,5);thumbnails[2574239]=new thumbnail(2574239,"","","2 small 160_thumb.jpg",130,87,5);thumbnails[2574243]=new thumbnail(2574243,"","","max with canvas small5_thumb.jpg",130,288,5);thumbnails[2574246]=new thumbnail(2574246,"","","4 small 160_thumb.jpg",130,87,5);thumbnails[2579835]=new thumbnail(2579835,"","","rumps_thumb.jpg",130,74,5);thumbnails[2580538]=new thumbnail(2580538,"","","TINTAGEL_2_thumb.jpg",130,81,5);thumbnails[2580542]=new thumbnail(2580542,"","","TINTAGEL_3_thumb.jpg",130,81,5);thumbnails[2610097]=new thumbnail(2610097,"","","tintagel_Castle_1_thumb.jpg",130,65,5);thumbnails[2625945]=new thumbnail(2625945,"","","merlins_cave_tintagel_castle_thumb.jpg",130,65,5);thumbnails[2626067]=new thumbnail(2626067,"","","tintagel_castle_thumb.jpg",130,65,5);thumbnails[3525539]=new thumbnail(3525539,"","","tintagel_castle3_thumb.jpg",130,65,5);thumbnails[3577516]=new thumbnail(3577516,"","","canvas_1_thumb.JPG",130,207,5);thumbnails[5172906]=new thumbnail(5172906,"","","photo_canvas_print_thumb.jpg",130,56,5);thumbnails[5172907]=new thumbnail(5172907,"","","trebarwith_386934D6-2219-B5B5-4CDBA45259D8AE71_thumb.jpg",130,74,5);thumbnails[5172960]=new thumbnail(5172960,"","","TINTAGEL__thumb.jpg",130,42,5);thumbnails[5190507]=new thumbnail(5190507,"","","canvas_photo_beach_thumb.jpg",130,68,5);thumbnails[5190509]=new thumbnail(5190509,"","","canvas_picture_thumb.jpg",130,109,5);thumbnails[5190514]=new thumbnail(5190514,"","","canvas_2_thumb.jpg",130,42,5);thumbnails[5532493]=new thumbnail(5532493,"","","Cornwall_photos_thumb.gif",130,28,5);thumbnails[6132968]=new thumbnail(6132968,"","","WHITE_FINISHED_SMALL_thumb.jpg",130,93,5);thumbnails[6132975]=new thumbnail(6132975,"","","BLACK_FINISHED_boscastle_thumb.jpg",130,93,5);thumbnails[6132983]=new thumbnail(6132983,"","","BLACK_FINISHED_huts1_thumb.jpg",130,169,5);thumbnails[6132990]=new thumbnail(6132990,"","","footsteps_121B5418-24E8-5EC4-4F538E97D24EFE6A_thumb.jpg",130,169,5);thumbnails[6389976]=new thumbnail(6389976,"","","Tintagel_Gate_F59DDCBA-1D09-001F-99677C37C1CB833F_thumb.jpg",130,195,5);thumbnails[2656179]=new thumbnail(2656179,"","Greeb Zawn Bay - Land's End","lands-end_thumb.jpg",130,86,5);thumbnails[2572646]=new thumbnail(2572646,"163907","Camelot - Tintagel","tintagel_castle_1_9581E4D9-1D09-001F-998DCDD68CD77947_thumb.jpg",130,87,5);thumbnails[2572730]=new thumbnail(2572730,"163907","Castle Headland - Tintagel","TINTAGEL_3_9575C063-1D09-001F-992A16CA63182799_thumb.jpg",130,87,5);thumbnails[2572788]=new thumbnail(2572788,"163907","From The Top - Tintagel","From_The_Top_Tintagel_thumb.jpg",130,87,5);thumbnails[2610630]=new thumbnail(2610630,"163907","Tintagel Island - Tintagel","tintagel_island_thumb.jpg",130,87,5);thumbnails[2610631]=new thumbnail(2610631,"163907","Looking Back - Tintagel","tintagel_back_thumb.jpg",130,87,5);thumbnails[2610633]=new thumbnail(2610633,"163907","Merlins Cave - Tintagel","merlins_cave_thumb.jpg",130,87,5);thumbnails[5455851]=new thumbnail(5455851,"163907","The Island - Tintagel","image07961_thumb.jpg",130,87,5);thumbnails[5456202]=new thumbnail(5456202,"163907","St Materiana's Church - Tintagel","image12600_thumb.jpg",130,87,5);thumbnails[5457442]=new thumbnail(5457442,"163907","Slate Stacks - Tintagel","image07950_thumb.jpg",130,87,5);thumbnails[2572625]=new thumbnail(2572625,"163907","Bossiney Beach","Bossiney_thumb.jpg",130,87,5);thumbnails[2610632]=new thumbnail(2610632,"218608","Trebarwith Strand - Cornwall","trebarwith_strand_thumb.jpg",130,87,5);thumbnails[5455755]=new thumbnail(5455755,"218608","Lower Penhallic Point - Between Trebarwith and Tintagel","image12590_thumb.jpg",130,87,5);thumbnails[5455819]=new thumbnail(5455819,"218608","View from Coastal Path - Trebarwith Strand","image07945_thumb.jpg",130,87,5);thumbnails[5455843]=new thumbnail(5455843,"218608","Trebarwith Strand - Near Tintagel","image14421_thumb.jpg",130,87,5);thumbnails[5456042]=new thumbnail(5456042,"218608","Above Trebarwith Strand ","trebarwith_strand_beach_thumb.jpg",130,87,5);thumbnails[5456090]=new thumbnail(5456090,"218608","Trebarwth Strand - From Port William, Cornwall","image12542_thumb.jpg",130,87,5);thumbnails[5457248]=new thumbnail(5457248,"218608","Above Port William - Trebarwith Strand","trebarwith_strand_above_thumb.jpg",130,87,5);thumbnails[5533247]=new thumbnail(5533247,"218608","Slate Stacks - Trebarwith Strand, Cornwall","trebarwith_strand_slate_thumb.jpg",130,87,5);thumbnails[5457392]=new thumbnail(5457392,"218608","Trebarwith Gold - Trebarwith Strand","trebarwith_strand__1_thumb.jpg",130,87,5);thumbnails[5457401]=new thumbnail(5457401,"218608","Gull Rock - Trebarwith Strand","trebarwith_strand____thumb.jpg",130,87,5);thumbnails[5457201]=new thumbnail(5457201,"218608","Trebarwith Strand at sunset","Trebarwith_Strand_at_sunset_north_Cornwall_3_thumb.jpg",130,88,5);thumbnails[3577542]=new thumbnail(3577542,"218657","Boscastle harbour and north Cornish coastline - Cornwall","Boscastle_harbour_and_north_Cornish_coastline_Cornwall__thumb.jpg",130,86,5);thumbnails[3577544]=new thumbnail(3577544,"218657","Boscastle Harbour - Boscastle","boscastle_harour_thumb.jpg",130,87,5);thumbnails[3577548]=new thumbnail(3577548,"218657","Boscastle Boats - Boscastle","_04K7685_EC15CEA5-24E8-5EC4-4FF555FF14DC2932_thumb.jpg",130,87,5);thumbnails[3577551]=new thumbnail(3577551,"218657","Boscastle Harbour Entrance from Cliff Path - Boscastle","_boscastle_thumb.jpg",130,87,5);thumbnails[3577554]=new thumbnail(3577554,"218657","Looking south - Above Boscastle","boscastle_cornwall_thumb.jpg",130,195,5);thumbnails[3577556]=new thumbnail(3577556,"218657","When the Boat comes in - Boscatle","BOSCASTLE_HARBOUR__thumb.jpg",130,195,5);thumbnails[3577564]=new thumbnail(3577564,"218657","The Harbour - Boscastle","boscastle_thumb.jpg",130,195,5);thumbnails[5457282]=new thumbnail(5457282,"308763","Trebarwith Strand coastal path","image07948_thumb.jpg",130,195,5);thumbnails[5457294]=new thumbnail(5457294,"308763","Rocks at Trebarwith Strand","image12559_thumb.jpg",130,195,5);thumbnails[5457301]=new thumbnail(5457301,"308763","Lower Penhallic Point - Trebarwith Strand, Tintagel","image12576_thumb.jpg",130,195,5);thumbnails[5457304]=new thumbnail(5457304,"308763","From Port William - Trebarwith Strand, Near Tintagel","image14422_thumb.jpg",130,195,5);thumbnails[5457309]=new thumbnail(5457309,"308763","Lower Penhallic Point - Tintagel","image12581_thumb.jpg",130,195,5);thumbnails[5457452]=new thumbnail(5457452,"308763","Looking south - Above Boscastle ","_04K7775_thumb.jpg",130,195,5);thumbnails[5457459]=new thumbnail(5457459,"308763","When the Boat comes in - Boscatle","_04K7733_thumb.jpg",130,195,5);thumbnails[2610399]=new thumbnail(2610399,"308763","Gull Rock - Trebarwith Strand","trebarwith_thumb.jpg",130,197,5);thumbnails[2610336]=new thumbnail(2610336,"308763","Trebarwith Strand","trebarwith strand_thumb.jpg",130,197,5);thumbnails[5456244]=new thumbnail(5456244,"308763","Castle Gate - Tintagel","Tintagel_Gate_thumb.jpg",130,195,5);thumbnails[5456257]=new thumbnail(5456257,"308763","Trebarwith B&W","Trebarwith__thumb.jpg",130,195,5);thumbnails[5456554]=new thumbnail(5456554,"308763","St Materiana's Church B&W - Tintagel","image12601_monochrome_thumb.jpg",130,195,5);thumbnails[3576727]=new thumbnail(3576727,"163908","Cape Cornwall Flowers","_Cape_Cornwall_Flowers_thumb.jpg",130,195,5);thumbnails[3576733]=new thumbnail(3576733,"163908","Habour Lights - Newlyn","newlyn_thumb.jpg",130,195,5);thumbnails[3576743]=new thumbnail(3576743,"163908","Deserted Dunes - Upton towans","_upton_towans_thumb.jpg",130,195,5);thumbnails[3576745]=new thumbnail(3576745,"163908","Archway To The Sea - Perranporth","perranporth1_thumb.jpg",130,195,5);thumbnails[3576762]=new thumbnail(3576762,"163908","Evening Retreat - Cape Cornwall","priests_cove_thumb.jpg",130,196,5);thumbnails[3576764]=new thumbnail(3576764,"163908","Passing Through - Upton towans","upton_towans_thumb.jpg",130,195,5);thumbnails[3576822]=new thumbnail(3576822,"163908","Surging Waters - Trevose Head Lighthouse ","_Trevose__thumb.jpg",130,195,5);thumbnails[3576863]=new thumbnail(3576863,"163908","Wonders Of Nature - Porth Nanven","Nanven_Beach_thumb.jpg",130,196,5);thumbnails[5464180]=new thumbnail(5464180,"163908","","polperro_9_thumb.jpg",130,195,5);thumbnails[2656175]=new thumbnail(2656175,"163908","On The Edge - Land's End","lands_end2_thumb.jpg",130,195,5);thumbnails[2656176]=new thumbnail(2656176,"163908","Swirling Seas - Cape Cornwall ","Cape_Cornwall_Rocks_thumb.jpg",130,195,5);thumbnails[2610303]=new thumbnail(2610303,"163908","Cornish Light - Porth Nanven ","porth_nanven_thumb.jpg",130,195,5);thumbnails[2656171]=new thumbnail(2656171,"163908","Emerald Green - Sennen cove","Sennen_Cove_thumb.jpg",130,197,5);thumbnails[2656170]=new thumbnail(2656170,"163908","Follow The Yellow Brick Road- St Michael's Mount","St_Michaels_Mount_21_thumb.jpg",130,195,5);thumbnails[2656169]=new thumbnail(2656169,"163908","Westerly winds - Bedruthan Steps, Cornwall","Bedruthan_Steps_thumb.jpg",130,197,5);thumbnails[3576923]=new thumbnail(3576923,"218610","Lanyon Quoit - Madron","Lanyon_Quoit_Madron_thumb.jpg",130,195,5);thumbnails[3576927]=new thumbnail(3576927,"218610","Rain Soaked - New Forest","New_Forest_thumb.jpg",130,195,5);thumbnails[3576939]=new thumbnail(3576939,"218610","Amongst The Heather - Lands End","Lands_End_Heather_thumb.jpg",130,195,5);thumbnails[3576942]=new thumbnail(3576942,"218610","Seven On The Hill - Exmoor ","_Exmoor___thumb.jpg",130,195,5);thumbnails[3577019]=new thumbnail(3577019,"218610","A Splash Of Red - South Downs","southdowns_thumb.jpg",130,195,5);thumbnails[2656172]=new thumbnail(2656172,"218610","Golitha Falls","Golitha_Falls__thumb.jpg",130,195,5);var galleries=new Object();galleries[163907]=new gallery(163907,"5457442,5456202,5455851,2610633,2610631,2610630,2572788,2572730,2572646,2572625","TINTAGEL GALLERY","gallery",[2572646,2572730,2572788,2610630,2610631,2610633,5455851,5456202,5457442,2572625]);galleries[218608]=new gallery(218608,"5533247,5457401,5457392,5457248,5457201,5456090,5456042,5455843,5455819,5455755","TREBARWITH STRAND","gallery",[2610632,5455755,5455819,5455843,5456042,5456090,5457248,5533247,5457392,5457401,5457201]);galleries[218657]=new gallery(218657,"3577542","BOSCASTLE","gallery",[3577542,3577544,3577548,3577551,3577554,3577556,3577564]);galleries[308764]=new gallery(308764,"","LATEST IMAGES","gallery",[]);galleries[308763]=new gallery(308763,"5457459,5457452,5457309,5457304,5457301,5457294,5457282,5456554,5456257,5456244","LOCAL IMAGES II","gallery",[5457282,5457294,5457301,5457304,5457309,5457452,5457459,2610399,2610336,5456244,5456257,5456554]);galleries[163908]=new gallery(163908,"3576733","CORNWALL COAST II","gallery",[3576727,3576733,3576743,3576745,3576762,3576764,3576822,3576863,5464180,2656175,2656176,2610303,2656171,2656170,2656169]);galleries[218610]=new gallery(218610,"3577019,3576942,3576939,3576927,3576923,2656172","LANDSCAPES II","gallery",[3576923,3576927,3576939,3576942,3577019,2656172]);var imageSets=new Object();imageSets[1]="5457442,5457401,5457392,5457248,5457201,5456202,5456090,5456042,5455851,5455843,5455819,5455755,3577548,3577542,2610633,2610632,2610631,2610630,2572730,2572646,2572625";imageSets[2]="3577542,3576733";imageSets[3]="5190514,5190509,5190507,5172960,5172907,5172906,3577564,3577556,3577554,3577551,3577548,3577544,3577542,3577516,3577019,3576942,3576939,3576927,3576923,3576863";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/Tintagelcastle/images";break}switch(a){case 1:b="http://www1.clikpic.com/Tintagelcastle/images";break}switch(a){case 2:b="http://admin.clikpic.com/Tintagelcastle/images";break}switch(a){case 24:b="http://tpc15/clikpic/Tintagelcastle/images";break}switch(a){case 4:b="http://www.clikchurch.com/Tintagelcastle/images";break}switch(a){case 5:b="http://www2.clikpic.com/Tintagelcastle/images";break}switch(a){case 22:b="http://tpc5/clikpic/Tintagelcastle/images";break}switch(a){case 23:b="http://tpc10/clikpic/Tintagelcastle/images";break}switch(a){case 25:b="http://tpc16/clikpic/Tintagelcastle/images";break}switch(a){case 15:b="http://www3.clikpic.com/Tintagelcastle/images";break}switch(a){case 18:b="http://www4.clikpic.com/Tintagelcastle/images";break}switch(a){case 19:b="http://www5.clikpic.com/Tintagelcastle/images";break}switch(a){case 31:b="http://www7.clikpic.com/Tintagelcastle/images";break}switch(a){case 32:b="http://admin2.clikpic.com/Tintagelcastle/images";break}switch(a){case 33:b="http://www8.clikpic.com/Tintagelcastle/images";break}switch(a){case 34:b="http://www9.clikpic.com/Tintagelcastle/images";break}switch(a){case 35:b="http://admin3.clikpic.com/Tintagelcastle/images";break}switch(a){case 37:b="http://admin4.clikpic.com/Tintagelcastle/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="Tintagel Castle: "+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>"}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="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="TINTAGELCASTLE">';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+'")'})}}};